mount-util: add umount_and_free() helper
This commit is contained in:
@@ -83,6 +83,14 @@ static inline char* umount_and_rmdir_and_free(char *p) {
|
||||
}
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, umount_and_rmdir_and_free);
|
||||
|
||||
static inline char *umount_and_free(char *p) {
|
||||
PROTECT_ERRNO;
|
||||
if (p)
|
||||
(void) umount_recursive(p, 0);
|
||||
return mfree(p);
|
||||
}
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, umount_and_free);
|
||||
|
||||
int bind_mount_in_namespace(pid_t target, const char *propagate_path, const char *incoming_path, const char *src, const char *dest, bool read_only, bool make_file_or_directory);
|
||||
int mount_image_in_namespace(pid_t target, const char *propagate_path, const char *incoming_path, const char *src, const char *dest, bool read_only, bool make_file_or_directory, const MountOptions *options, const ImagePolicy *image_policy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user