]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add ply_move_mount().
authorPeter Jones <pjones@redhat.com>
Wed, 4 Jun 2008 16:03:35 +0000 (12:03 -0400)
committerPeter Jones <pjones@pjones2.localdomain>
Wed, 4 Jun 2008 16:03:35 +0000 (12:03 -0400)
src/libply/ply-utils.c
src/libply/ply-utils.h

index 625f2318df5f1ecbfa8f89afc555e089f05801ff..c9a313f447f73d6d3274a24eaa8c619e5d00396d 100644 (file)
@@ -39,6 +39,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/un.h>
+#include <linux/fs.h>
 
 #include <dlfcn.h>
 
@@ -984,6 +985,20 @@ ply_unmount_filesystem (const char *directory)
   return true;
 }
 
+bool
+ply_move_mount (const char *source, const char *destination)
+{
+  int rc;
+  ply_trace ("moving mount at \"%s\" to \"%s\"", source, destination);
+
+  if (mount(source, destination, NULL, MS_MOVE, NULL) < 0)
+    {
+      ply_trace("mount(\"%s\", \"%s\", NULL, MS_MOVE, NULL): error: %m", source, destination);
+      return false;
+    }
+  return true;
+}
+
 ply_daemon_handle_t *
 ply_create_daemon (void)
 {
index e9803c96834f571d6825158bf5718956d0bd19f9..3a2cc9964d12b8216a3282da536e5a2837f6f2b2 100644 (file)
@@ -88,6 +88,7 @@ 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);
 
 ply_daemon_handle_t *ply_create_daemon (void);
 bool ply_detach_daemon (ply_daemon_handle_t *handle,