X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=fd.c;h=4fbdfd05866f6a2cb3636fc908d293004a215947;hp=4ac61709da8a2ddc6b4077cf51c5053d30777dab;hb=e20dedbac369be3f69cc56221730fe2ee41e745c;hpb=a0b87ba0529cc6ab075e1d7a11f8b4adc47948eb diff --git a/fd.c b/fd.c index 4ac6170..4fbdfd0 100644 --- a/fd.c +++ b/fd.c @@ -35,11 +35,8 @@ int for_each_subdir(int (*func)(const char *, void *), void *private_data) int ret; DIR *dir = opendir("."); - if (!dir) { - ret = -ERRNO_TO_DSS_ERROR(errno); - make_err_msg("opendir(\".\") failed"); - return ret; - } + if (!dir) + return -ERRNO_TO_DSS_ERROR(errno); while ((entry = readdir(dir))) { mode_t m; struct stat s; @@ -51,7 +48,6 @@ int for_each_subdir(int (*func)(const char *, void *), void *private_data) ret = lstat(entry->d_name, &s) == -1; if (ret == -1) { ret = -ERRNO_TO_DSS_ERROR(errno); - make_err_msg("lstat(\"%s\") failed", entry->d_name); goto out; } m = s.st_mode; @@ -75,13 +71,9 @@ out: */ int dss_chdir(const char *path) { - int ret = chdir(path); - - if (ret >= 0) + if (chdir(path) >= 0) return 1; - ret = -ERRNO_TO_DSS_ERROR(errno); - make_err_msg("chdir to %s failed", path); - return ret; + return -ERRNO_TO_DSS_ERROR(errno); } /**