Rename para_rename() and move it to fd.h.
authorAndre Noll <maan@systemlinux.org>
Wed, 4 Jun 2008 21:22:34 +0000 (23:22 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 4 Jun 2008 21:22:34 +0000 (23:22 +0200)
fd.h
osl.c
osl_core.h

diff --git a/fd.h b/fd.h
index 55f1cac..bb09eb3 100644 (file)
--- 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 (file)
--- 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)
index a6342f8..858743a 100644 (file)
@@ -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.
  *