Check return value of chdir() to make gcc happy