From f20ee31e76615776f4b56d57a3a4fc1919de2914 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 4 Jun 2008 23:22:34 +0200 Subject: [PATCH] Rename para_rename() and move it to fd.h. --- fd.h | 16 ++++++++++++++++ osl.c | 2 +- osl_core.h | 17 ----------------- 3 files changed, 17 insertions(+), 18 deletions(-) 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. * -- 2.39.5