]> git.tuebingen.mpg.de Git - osl.git/commitdiff
Make para_mkdir() static inline and rename it to osl_mkdir().
authorAndre Noll <maan@systemlinux.org>
Wed, 4 Jun 2008 21:19:21 +0000 (23:19 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 4 Jun 2008 21:19:21 +0000 (23:19 +0200)
fd.c
fd.h
osl.c

diff --git a/fd.c b/fd.c
index 13708ac64f3e4b490703408dd371fcd504eb5f43..95976d6817fba4e6571f4a2ac3eab3673af18353 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -144,21 +144,6 @@ int para_fchdir(int fd)
        return 1;
 }
 
        return 1;
 }
 
-/**
- * A wrapper for mkdir(2).
- *
- * \param path Name of the directory to create.
- * \param mode The permissions to use.
- *
- * \return Standard.
- */
-int para_mkdir(const char *path, mode_t mode)
-{
-       if (!mkdir(path, mode))
-               return 1;
-       return -ERRNO_TO_ERROR(errno);
-}
-
 /**
  * Open a file and map it into memory.
  *
 /**
  * Open a file and map it into memory.
  *
diff --git a/fd.h b/fd.h
index a01f920e9acb9c46baa1007d4f74da31f4d60778..55f1cacb6897c7012aa342eb1130449e3b5e2109 100644 (file)
--- a/fd.h
+++ b/fd.h
@@ -8,8 +8,23 @@
 
 int osl_open(const char *path, int flags, mode_t mode);
 int para_opendir(const char *dirname, DIR **dir, int *cwd);
 
 int osl_open(const char *path, int flags, mode_t mode);
 int para_opendir(const char *dirname, DIR **dir, int *cwd);
-int para_mkdir(const char *path, mode_t mode);
 int para_fchdir(int fd);
 int mmap_full_file(const char *filename, int open_mode, void **map,
        size_t *size, int *fd_ptr);
 int para_munmap(void *start, size_t length);
 int para_fchdir(int fd);
 int mmap_full_file(const char *filename, int open_mode, void **map,
        size_t *size, int *fd_ptr);
 int para_munmap(void *start, size_t length);
+
+/**
+ * A wrapper for mkdir(2).
+ *
+ * \param path Name of the directory to create.
+ * \param mode The permissions to use.
+ *
+ * \return Standard.
+ */
+static inline int osl_mkdir(const char *path, mode_t mode)
+{
+       if (!mkdir(path, mode))
+               return 1;
+       return -ERRNO_TO_ERROR(errno);
+}
+
diff --git a/osl.c b/osl.c
index d41923f0f602b75c20eb7d6bcfec5b779896428d..5c6f93ed60c2f7b9a1357b1aba92c7a4b827aa4d 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -674,7 +674,7 @@ __export int osl_create_table(const struct osl_table_description *desc)
                if (cd->storage_type == OSL_NO_STORAGE)
                        continue;
                if (!table_dir) {
                if (cd->storage_type == OSL_NO_STORAGE)
                        continue;
                if (!table_dir) {
-                       ret = para_mkdir(desc->dir, 0777);
+                       ret = osl_mkdir(desc->dir, 0777);
                        if (ret < 0 && !is_errno(-ret, EEXIST))
                                goto out;
                        table_dir = make_message("%s/%s", desc->dir,
                        if (ret < 0 && !is_errno(-ret, EEXIST))
                                goto out;
                        table_dir = make_message("%s/%s", desc->dir,
@@ -682,7 +682,7 @@ __export int osl_create_table(const struct osl_table_description *desc)
                        ret = -ERRNO_TO_ERROR(ENOMEM);
                        if (!table_dir)
                                goto out;
                        ret = -ERRNO_TO_ERROR(ENOMEM);
                        if (!table_dir)
                                goto out;
-                       ret = para_mkdir(table_dir, 0777);
+                       ret = osl_mkdir(table_dir, 0777);
                        if (ret < 0)
                                goto out;
                }
                        if (ret < 0)
                                goto out;
                }
@@ -701,7 +701,7 @@ __export int osl_create_table(const struct osl_table_description *desc)
                        continue;
                }
                /* DISK STORAGE */
                        continue;
                }
                /* DISK STORAGE */
-               ret = para_mkdir(filename, 0777);
+               ret = osl_mkdir(filename, 0777);
                free(filename);
                if (ret < 0)
                        goto out;
                free(filename);
                if (ret < 0)
                        goto out;
@@ -1252,7 +1252,7 @@ static int create_disk_storage_object_dir(const struct osl_table *t,
        dirname = disk_storage_dirname(t, col_num, ds_name);
        if (!dirname)
                return -ERRNO_TO_ERROR(ENOMEM);
        dirname = disk_storage_dirname(t, col_num, ds_name);
        if (!dirname)
                return -ERRNO_TO_ERROR(ENOMEM);
-       ret = para_mkdir(dirname, 0777);
+       ret = osl_mkdir(dirname, 0777);
        free(dirname);
        if (ret < 0 && !is_errno(-ret, EEXIST))
                return ret;
        free(dirname);
        if (ret < 0 && !is_errno(-ret, EEXIST))
                return ret;