]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
More error cleanups.
authorAndre Noll <maan@systemlinux.org>
Sat, 15 Dec 2007 16:45:01 +0000 (17:45 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 15 Dec 2007 16:45:01 +0000 (17:45 +0100)
error.h
osl.c
osl_core.h

diff --git a/error.h b/error.h
index 9b25e1f7050440905a8e8265b1ace51a497c333b..4bc9f1555e274049d041e2895d31c1263469845f 100644 (file)
--- 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 9843a02034fc8927bdcce36be4bc6f7959d6f88d..41318976963e92fbe8fec2618aa10775734dc59a 100644 (file)
--- 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;
index 599d22da6146c8cb88c5330a1a347c4b3b88c756..a23bb3d9d0652dbc8811032240a14fba7db05ce4 100644 (file)
@@ -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;
 }