summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-06-04 12:03:35 -0400
committerPeter Jones <pjones@pjones2.localdomain>2008-06-04 12:03:35 -0400
commita47e2686097e88e2ee47075d3ab1cf1b0e671df1 (patch)
treecde547af5029f07e6141a446b3c0eb3586263d9d /src
parent74c016281def0f532385e651fce892527ba83f0b (diff)
downloadplymouth-a47e2686097e88e2ee47075d3ab1cf1b0e671df1.tar.gz
plymouth-a47e2686097e88e2ee47075d3ab1cf1b0e671df1.tar.xz
plymouth-a47e2686097e88e2ee47075d3ab1cf1b0e671df1.zip
Add ply_move_mount().
Diffstat (limited to 'src')
-rw-r--r--src/libply/ply-utils.c15
-rw-r--r--src/libply/ply-utils.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
index 625f231..c9a313f 100644
--- a/src/libply/ply-utils.c
+++ b/src/libply/ply-utils.c
@@ -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)
{
diff --git a/src/libply/ply-utils.h b/src/libply/ply-utils.h
index e9803c9..3a2cc99 100644
--- a/src/libply/ply-utils.h
+++ b/src/libply/ply-utils.h
@@ -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,