summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-06-04 13:28:15 -0400
committerPeter Jones <pjones@pjones2.localdomain>2008-06-04 13:28:15 -0400
commit9ebe607e75b3170d27f12cd4802b5cbcc865d381 (patch)
tree659176f1fb2985ec4ef46d33702e83bad85ba979 /src
parent44ab737bd0929d7d3eeac01ebbcd59916c56471a (diff)
downloadplymouth-9ebe607e75b3170d27f12cd4802b5cbcc865d381.tar.gz
plymouth-9ebe607e75b3170d27f12cd4802b5cbcc865d381.tar.xz
plymouth-9ebe607e75b3170d27f12cd4802b5cbcc865d381.zip
Remove ply_create_detachable_directory() and ply_detach_directory(), add
ply_mount_tmpfs() to do the part of that we still need.
Diffstat (limited to 'src')
-rw-r--r--src/libply/ply-utils.c60
-rw-r--r--src/libply/ply-utils.h3
2 files changed, 12 insertions, 51 deletions
diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c
index c9a313f..bf72cea 100644
--- a/src/libply/ply-utils.c
+++ b/src/libply/ply-utils.c
@@ -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)
{
diff --git a/src/libply/ply-utils.h b/src/libply/ply-utils.h
index 3a2cc99..720e6e4 100644
--- a/src/libply/ply-utils.h
+++ b/src/libply/ply-utils.h
@@ -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,