From 6ce3524dbc2e688aca298836cef0d3f314f70d9b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 10 Oct 2007 19:50:12 +0200 Subject: [PATCH] Get rid of E_FCHDIR. Return the system error code instead. --- error.h | 1 - fd.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/error.h b/error.h index d7a6d031..d2481900 100644 --- a/error.h +++ b/error.h @@ -410,7 +410,6 @@ extern const char **para_errlist[]; #define FD_ERRORS \ PARA_ERROR(FGETS, "fgets error"), \ PARA_ERROR(CHDIR, "failed to change directory"), \ - PARA_ERROR(FCHDIR, "fchdir failed"), \ PARA_ERROR(OPEN, "failed to open file"), \ PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \ diff --git a/fd.c b/fd.c index 0065887d..22550286 100644 --- a/fd.c +++ b/fd.c @@ -206,7 +206,7 @@ int para_chdir(const char *path) * \param dir Result pointer. * \param cwd File descriptor of the current working directory. * - * \return Positive on success, negative on errors. + * \return Standard. * * Opening the current directory (".") and calling fchdir() to return is * usually faster and more reliable than saving cwd in some buffer and calling @@ -255,12 +255,12 @@ close_cwd: * * \param fd An open file descriptor * - * \return Positive on success, negative on errors. + * \return Standard. */ int para_fchdir(int fd) { if (fchdir(fd) < 0) - return -E_FCHDIR; + return -ERRNO_TO_PARA_ERROR(errno); return 1; } -- 2.30.2