+23
-9
@@ -1,26 +1,22 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <linux/loop.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "chase.h"
|
||||
#include "dissect-image.h"
|
||||
#include "exec-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "fstab-util.h"
|
||||
#include "glyph-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "initrd-util.h"
|
||||
#include "label-util.h"
|
||||
#include "libmount-util.h"
|
||||
#include "log.h"
|
||||
#include "missing_syscall.h"
|
||||
@@ -28,14 +24,13 @@
|
||||
#include "mount-util.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "namespace-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "os-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pidref.h"
|
||||
#include "process-util.h"
|
||||
#include "set.h"
|
||||
#include "sort-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tmpfile-util.h"
|
||||
@@ -1873,6 +1868,25 @@ int make_fsmount(
|
||||
return TAKE_FD(mnt_fd);
|
||||
}
|
||||
|
||||
char* umount_and_rmdir_and_free(char *p) {
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
PROTECT_ERRNO;
|
||||
(void) umount_recursive(p, 0);
|
||||
(void) rmdir(p);
|
||||
return mfree(p);
|
||||
}
|
||||
|
||||
char* umount_and_free(char *p) {
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
PROTECT_ERRNO;
|
||||
(void) umount_recursive(p, 0);
|
||||
return mfree(p);
|
||||
}
|
||||
|
||||
char* umount_and_unlink_and_free(char *p) {
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user