X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=fd.c;h=7b23df223396959728b7064d4088c2d69233dd68;hp=4ac61709da8a2ddc6b4077cf51c5053d30777dab;hb=6e42820324ffb57f3d1fc1e58e1ec5bbdf97c820;hpb=a0b87ba0529cc6ab075e1d7a11f8b4adc47948eb diff --git a/fd.c b/fd.c index 4ac6170..7b23df2 100644 --- a/fd.c +++ b/fd.c @@ -1,3 +1,9 @@ +/* + * Copyright (C) 2006-2008 Andre Noll + * + * Licensed under the GPL v2. For licencing details see COPYING. + */ + #include #include #include @@ -35,11 +41,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 +54,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 +77,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); } /**