chiark / gitweb /
tree-wide: add new SIGNAL_VALID() macro-like function that validates signal numbers
[elogind.git] / src / basic / mount-util.c
index ff5893d3dbde979c45973f6f1c73cdf29cbbb74d..51734a1bf9b2401950d748c7f0906c3f1e80ba4d 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 /***
   This file is part of systemd.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <sys/mount.h>
+#include <sys/stat.h>
 #include <sys/statvfs.h>
+#include <unistd.h>
 
 #include "alloc-util.h"
 #include "escape.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "hashmap.h"
 #include "mount-util.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
 #include "stdio-util.h"
 #include "string-util.h"
-#include "util.h"
 
 static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) {
         char path[strlen("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)];
@@ -45,7 +47,7 @@ static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id
         if ((flags & AT_EMPTY_PATH) && isempty(filename))
                 xsprintf(path, "/proc/self/fdinfo/%i", fd);
         else {
-                subfd = openat(fd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH);
+                subfd = openat(fd, filename, O_CLOEXEC|O_PATH);
                 if (subfd < 0)
                         return -errno;
 
@@ -228,15 +230,14 @@ int path_is_mount_point(const char *t, int flags) {
         if (!parent)
                 return -ENOMEM;
 
-        fd = openat(AT_FDCWD, parent, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_PATH);
+        fd = openat(AT_FDCWD, parent, O_DIRECTORY|O_CLOEXEC|O_PATH);
         if (fd < 0)
                 return -errno;
 
         return fd_is_mount_point(fd, basename(t), flags);
 }
 
-/// UNNEEDED by elogind
-#if 0
+#if 0 /// UNNEEDED by elogind
 int umount_recursive(const char *prefix, int flags) {
         bool again;
         int n = 0, r;