From: Andre Noll Date: Wed, 4 Jun 2008 21:19:21 +0000 (+0200) Subject: Make para_mkdir() static inline and rename it to osl_mkdir(). X-Git-Tag: v0.1.0~82^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=093138ba762b3179f4d0375bbaf4250b9e016289;p=osl.git Make para_mkdir() static inline and rename it to osl_mkdir(). --- diff --git a/fd.c b/fd.c index 13708ac..95976d6 100644 --- a/fd.c +++ b/fd.c @@ -144,21 +144,6 @@ int para_fchdir(int fd) 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. * diff --git a/fd.h b/fd.h index a01f920..55f1cac 100644 --- 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 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); + +/** + * 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 d41923f..5c6f93e 100644 --- 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) { - 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, @@ -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 = para_mkdir(table_dir, 0777); + ret = osl_mkdir(table_dir, 0777); if (ret < 0) goto out; } @@ -701,7 +701,7 @@ __export int osl_create_table(const struct osl_table_description *desc) continue; } /* DISK STORAGE */ - ret = para_mkdir(filename, 0777); + ret = osl_mkdir(filename, 0777); 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); - ret = para_mkdir(dirname, 0777); + ret = osl_mkdir(dirname, 0777); free(dirname); if (ret < 0 && !is_errno(-ret, EEXIST)) return ret;