From: Peter Jones Date: Wed, 4 Jun 2008 16:03:35 +0000 (-0400) Subject: Add ply_move_mount(). X-Git-Tag: 0.2.0~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a47e2686097e88e2ee47075d3ab1cf1b0e671df1;p=thirdparty%2Fplymouth.git Add ply_move_mount(). --- diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c index 625f2318..c9a313f4 100644 --- a/src/libply/ply-utils.c +++ b/src/libply/ply-utils.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -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 e9803c96..3a2cc996 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,