From: Andre Noll Date: Wed, 4 Jun 2008 21:22:34 +0000 (+0200) Subject: Rename para_rename() and move it to fd.h. X-Git-Tag: v0.1.0~82^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=commitdiff_plain;h=f20ee31e76615776f4b56d57a3a4fc1919de2914 Rename para_rename() and move it to fd.h. --- diff --git a/fd.h b/fd.h index 55f1cac..bb09eb3 100644 --- a/fd.h +++ b/fd.h @@ -28,3 +28,19 @@ static inline int osl_mkdir(const char *path, mode_t mode) return -ERRNO_TO_ERROR(errno); } +/** + * A wrapper for rename(2). + * + * \param old_path The source path. + * \param new_path The destination path. + * + * \return Standard. + * + * \sa rename(2). + */ +_static_inline_ int osl_rename(const char *old_path, const char *new_path) +{ + if (rename(old_path, new_path) < 0) + return -ERRNO_TO_ERROR(errno); + return 1; +} diff --git a/osl.c b/osl.c index 5c6f93e..0c43801 100644 --- a/osl.c +++ b/osl.c @@ -1713,7 +1713,7 @@ static int rename_disk_storage_objects(struct osl_table *t, if (!old_filename || !new_filename) ret = -ERRNO_TO_ERROR(ENOMEM); else - ret = para_rename(old_filename, new_filename); + ret = osl_rename(old_filename, new_filename); free(old_filename); free(new_filename); if (ret < 0) diff --git a/osl_core.h b/osl_core.h index a6342f8..858743a 100644 --- a/osl_core.h +++ b/osl_core.h @@ -473,23 +473,6 @@ _static_inline_ char *disk_storage_name_of_hash(const struct osl_table *t, HASH_ return strdup(asc); } -/** - * A wrapper for rename(2). - * - * \param old_path The source path. - * \param new_path The destination path. - * - * \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 -ERRNO_TO_ERROR(errno); - return 1; -} - /** * Iterate over each column of an initialized table. *