Get rid of all remaining users of ERRNO_TO_ERROR() in osl.c.
authorAndre Noll <maan@systemlinux.org>
Thu, 11 Jun 2009 20:49:03 +0000 (22:49 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 11 Jun 2009 20:49:03 +0000 (22:49 +0200)
errlist
osl.c

diff --git a/errlist b/errlist
index dfd9f6feada689cee3b1f109f21f437e2548ac8f..e4435df162cfd63a6eb25ed26c87126e031290e5 100644 (file)
--- a/errlist
+++ b/errlist
@@ -33,3 +33,6 @@ EMPTY                         "file empty"
 MMAP                           "mmap error"
 LOOP                           "loop terminated"
 NOMEM                          "cannot allocate memory"
+NOTDIR                         "not a directory"
+STAT                           "stat error"
+UNLINK                         "failed to unlink file"
diff --git a/osl.c b/osl.c
index 295c88e5e4aa22b7544e729efb8c652fe1e9f546..3f55ed4c24fc3217e6f4925b1b0e6b8d82de550a 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -1073,10 +1073,10 @@ __export int osl_open_table(const struct osl_table_description *table_desc,
                ret = stat(dirname, &statbuf);
                free(dirname);
                if (ret < 0) {
-                       ret = -ERRNO_TO_ERROR(errno);
+                       ret = -E_OSL_STAT;
                        goto err;
                }
-               ret = -ERRNO_TO_ERROR(ENOTDIR);
+               ret = -E_OSL_NOTDIR;
                if (!S_ISDIR(statbuf.st_mode))
                        goto err;
        }
@@ -1186,7 +1186,7 @@ static int delete_disk_storage_file(const struct osl_table *t, unsigned col_num,
        err = errno;
        free(filename);
        if (ret < 0)
-               return -ERRNO_TO_ERROR(err);
+               return -E_OSL_UNLINK;
        if (!(t->desc->flags & OSL_LARGE_TABLE))
                return 1;
        dirname = disk_storage_dirname(t, col_num, ds_name);