From: Andre Noll Date: Wed, 10 Oct 2007 17:45:45 +0000 (+0200) Subject: Get rid of E_OPENDIR. X-Git-Tag: v0.3.0~287 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=09156a37fad2aa874b4f71b993bafa8902a8bad2;p=paraslash.git Get rid of E_OPENDIR. Return the system error instead. --- diff --git a/error.h b/error.h index 537e7393..d7a6d031 100644 --- a/error.h +++ b/error.h @@ -411,7 +411,6 @@ extern const char **para_errlist[]; PARA_ERROR(FGETS, "fgets error"), \ PARA_ERROR(CHDIR, "failed to change directory"), \ PARA_ERROR(FCHDIR, "fchdir failed"), \ - PARA_ERROR(OPENDIR, "can not open directory"), \ PARA_ERROR(OPEN, "failed to open file"), \ PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \ diff --git a/fd.c b/fd.c index 08a06589..0065887d 100644 --- a/fd.c +++ b/fd.c @@ -236,11 +236,10 @@ int para_opendir(const char *dirname, DIR **dir, int *cwd) ret = para_chdir(dirname); if (ret < 0) goto close_cwd; - ret = -E_OPENDIR; *dir = opendir("."); - if (!*dir) - goto change_to_orig_dir; - return 1; + if (*dir) + return 1; + ret = -ERRNO_TO_PARA_ERROR(errno); /* Ignore return value of fchdir() and close(). We're busted anyway. */ change_to_orig_dir: if (cwd)