]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Remove ply_create_detachable_directory() and ply_detach_directory(), add
authorPeter Jones <pjones@redhat.com>
Wed, 4 Jun 2008 17:28:15 +0000 (13:28 -0400)
committerPeter Jones <pjones@pjones2.localdomain>
Wed, 4 Jun 2008 17:28:15 +0000 (13:28 -0400)
ply_mount_tmpfs() to do the part of that we still need.

src/libply/ply-utils.c
src/libply/ply-utils.h

index c9a313f447f73d6d3274a24eaa8c619e5d00396d..bf72cea247f8f3d7487beb2d8c38a61d25c0b7e9 100644 (file)
@@ -751,55 +751,6 @@ ply_create_directory (const char *directory)
   return true;
 }
 
-bool 
-ply_create_detachable_directory (const char *directory)
-{
-
-  assert (directory != NULL);
-  assert (directory[0] != '\0');
-  
-  ply_trace ("trying to create directory '%s'", directory);
-  if (!ply_create_directory (directory))
-    return false;
-
-  if (mount ("none", directory, "tmpfs", 0, NULL) < 0)
-    return false;
-
-  return true;
-}
-
-int
-ply_detach_directory (const char *directory)
-{
-  int dir_fd;
-
-  dir_fd = open (directory, O_RDONLY);
-
-  if (dir_fd < 0)
-    {
-      ply_save_errno ();
-      umount (directory);
-      ply_restore_errno ();
-      return dir_fd;
-    }
-
-  if (!ply_unmount_filesystem (directory))
-    {
-      ply_save_errno ();
-      umount (directory);
-      ply_restore_errno ();
-      return false;
-    }
-  rmdir (directory);
-
-  /* return a file descriptor to the directory because it's now been
-   * detached from the filesystem.  The user can fchdir to this
-   * directory and work from it that way
-   */
-
-  return dir_fd;
-}
-
 static bool
 ply_copy_subdirectory (const char *subdirectory,
                        const char *parent,
@@ -985,6 +936,17 @@ ply_unmount_filesystem (const char *directory)
   return true;
 }
 
+bool ply_mount_tmpfs (const char *directory)
+{
+  assert (directory != NULL);
+  assert (directory[0] != '\0');
+
+  if (mount ("none", directory, "tmpfs", 0, NULL) < 0)
+    return false;
+
+  return true;
+}
+
 bool
 ply_move_mount (const char *source, const char *destination)
 {
index 3a2cc9964d12b8216a3282da536e5a2837f6f2b2..720e6e46b5c852cf3f3e708698d50144caeb02b5 100644 (file)
@@ -83,12 +83,11 @@ ply_module_function_t ply_module_look_up_function (ply_module_handle_t *handle,
 void ply_close_module (ply_module_handle_t *handle);
 
 bool ply_create_directory (const char *directory);
-bool ply_create_detachable_directory (const char *directory);
-int ply_detach_directory (const char *directory);
 bool ply_copy_file (const char *source, const char *destination);
 bool ply_copy_directory (const char *source, const char *destination);
 bool ply_unmount_filesystem (const char *directory);
 bool ply_move_mount (const char *source, const char *destination);
+bool ply_mount_tmpfs (const char *directory);
 
 ply_daemon_handle_t *ply_create_daemon (void);
 bool ply_detach_daemon (ply_daemon_handle_t *handle,