]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - osl.c
Remove unused -E_LSTAT.
[paraslash.git] / osl.c
diff --git a/osl.c b/osl.c
index f38ba58bcb23a4c8a23525fda1c8570444b35822..fa37dea95ce42faec7131e0b371c837790361c3d 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -12,9 +12,6 @@
 #include <dirent.h> /* readdir() */
 #include <assert.h>
 
-//#define FMT_OFF_T "%li"
-
-
 /**
  * A wrapper for lseek(2).
  *
@@ -41,7 +38,7 @@ int para_lseek(int fd, off_t *offset, int whence)
 }
 
 /**
- * Waraper for the write system call.
+ * Wrapper for the write system call.
  *
  * \param fd The file descriptor to write to.
  * \param buf The buffer to write.
@@ -270,7 +267,6 @@ int for_each_file_in_dir(const char *dirname,
         * and calling chdir() afterwards (see man 3 getcwd).
         */
        int cwd_fd = open(".", O_RDONLY);
-       struct stat s;
        int ret = -1;
 
 //     PARA_DEBUG_LOG("dirname: %s\n", dirname);
@@ -287,12 +283,12 @@ int for_each_file_in_dir(const char *dirname,
        while ((entry = readdir(dir))) {
                mode_t m;
                char *tmp;
+               struct stat s;
 
                if (!strcmp(entry->d_name, "."))
                        continue;
                if (!strcmp(entry->d_name, ".."))
                        continue;
-               ret = -E_OSL_LSTAT;
                if (lstat(entry->d_name, &s) == -1)
                        continue;
                m = s.st_mode;
@@ -337,7 +333,7 @@ int para_mkdir(const char *path, mode_t mode)
        return -E_MKDIR;
 }
 
-static int verify_basename(const char *name)
+static int verify_name(const char *name)
 {
        if (!name)
                return -E_BAD_NAME;
@@ -432,7 +428,7 @@ static int init_column_descriptions(struct osl_table *t)
        const struct osl_column_description *cd;
 
        ret = -E_BAD_TABLE_DESC;
-       ret = verify_basename(t->desc->name);
+       ret = verify_name(t->desc->name);
        if (ret < 0)
                goto err;
        ret = -E_BAD_DB_DIR;
@@ -451,7 +447,7 @@ static int init_column_descriptions(struct osl_table *t)
                ret = -E_NO_COLUMN_NAME;
                if (!cd->name || !cd->name[0])
                        goto err;
-               ret = verify_basename(cd->name);
+               ret = verify_name(cd->name);
                if (ret < 0)
                        goto err;
                t->index_header_size += index_column_description_size(cd->name);