From f0380a05616524b149fa34f4a0873d9063ca2a95 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 15 Dec 2007 17:45:01 +0100 Subject: [PATCH] More error cleanups. --- error.h | 3 --- osl.c | 2 +- osl_core.h | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/error.h b/error.h index 9b25e1f7..4bc9f155 100644 --- a/error.h +++ b/error.h @@ -63,7 +63,6 @@ extern const char **para_errlist[]; PARA_ERROR(INDEX_CORRUPTION, "index corruption detected"), \ PARA_ERROR(INVALID_OBJECT, "reference to invalid object"), \ PARA_ERROR(STAT, "can not stat file"), \ - PARA_ERROR(RENAME, "rename failed"), \ PARA_ERROR(WRITE, "write error"), \ PARA_ERROR(LSEEK, "lseek error"), \ PARA_ERROR(BUSY, "table is busy"), \ @@ -352,8 +351,6 @@ extern const char **para_errlist[]; #define FD_ERRORS \ PARA_ERROR(FGETS, "fgets error"), \ - PARA_ERROR(OPEN, "failed to open file"), \ - PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \ PARA_ERROR(EMPTY, "file empty"), \ PARA_ERROR(MMAP, "mmap error"), \ PARA_ERROR(MUNMAP, "munmap failed"), \ diff --git a/osl.c b/osl.c index 9843a020..41318976 100644 --- a/osl.c +++ b/osl.c @@ -179,7 +179,7 @@ int for_each_file_in_dir(const char *dirname, int cwd_fd, ret2, ret = para_opendir(dirname, &dir, &cwd_fd); if (ret < 0) - return ret == -E_CHDIR_PERM? 1 : ret; + return ret == -ERRNO_TO_PARA_ERROR(EACCES)? 1 : ret; /* scan cwd recursively */ while ((entry = readdir(dir))) { mode_t m; diff --git a/osl_core.h b/osl_core.h index 599d22da..a23bb3d9 100644 --- a/osl_core.h +++ b/osl_core.h @@ -476,14 +476,14 @@ static inline char *disk_storage_name_of_hash(const struct osl_table *t, HASH_TY * \param old_path The source path. * \param new_path The destination path. * - * \return positive in success, \p -E_RENAME on errors. + * \return Standard. * * \sa rename(2). */ static inline int para_rename(const char *old_path, const char *new_path) { if (rename(old_path, new_path) < 0) - return -E_RENAME; + return -ERRNO_TO_PARA_ERROR(errno); return 1; } -- 2.30.2