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 55f1cacb6897c7012aa342eb1130449e3b5e2109..bb09eb3eb3d0ecafd1a71cc49c579b5e8a0f7c1f 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 5c6f93ed60c2f7b9a1357b1aba92c7a4b827aa4d..0c43801c4d7c27deecfa985d1788008822efe424 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 a6342f8e74db1aa5174e0bfea2a6e128de1b8add..858743aae308c236d242586abdcf6ac50e99ee0e 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.
  *