X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=fsck.c;h=b5e4fdbe16e0fc593e303de69de8e521b845ed31;hp=574509fcebdda24c52a8a1e45d0f4c94f6c6eef3;hb=a00170132c28eeea61033d820c22e8d48d35a0fd;hpb=41c4262daac7908ad77896e862811c4b34fe0532 diff --git a/fsck.c b/fsck.c index 574509f..b5e4fdb 100644 --- a/fsck.c +++ b/fsck.c @@ -208,6 +208,20 @@ static int uint32_compare(const struct osl_object *obj1, const struct osl_object return 0; } +/** + * A wrapper for fchdir(). + * + * \param fd An open file descriptor. + * + * \return Standard. + */ +static inline int __fchdir(int fd) +{ + if (fchdir(fd) < 0) + return -ERRNO_TO_ERROR(errno); + return 1; +} + /** * Traverse the given directory recursively. * @@ -263,7 +277,7 @@ static int for_each_file_in_dir(const char *dirname, ret = 1; out: closedir(dir); - ret2 = para_fchdir(cwd_fd); + ret2 = __fchdir(cwd_fd); if (ret2 < 0 && ret >= 0) ret = ret2; close(cwd_fd); @@ -1126,7 +1140,7 @@ static int check_all_tables(char *db_dir) break; } closedir(dir); - ret2 = para_fchdir(cwd_fd); + ret2 = __fchdir(cwd_fd); if (ret2 < 0 && ret >= 0) ret = ret2; close(cwd_fd);