chiark / gitweb /
basic/time-util: make parsing of dual_timestamp more strict
[elogind.git] / src / basic / stat-util.c
index b62acdb7a164420435858f754a8a1bb2d6b9726d..d262fe16a674eda3ecb7f704591367a9e4c4ca8e 100644 (file)
@@ -212,7 +212,7 @@ int fd_check_fstype(int fd, statfs_f_type_t magic_value) {
 int path_check_fstype(const char *path, statfs_f_type_t magic_value) {
         _cleanup_close_ int fd = -1;
 
-        fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY);
+        fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH);
         if (fd < 0)
                 return -errno;
 
@@ -225,6 +225,7 @@ bool is_temporary_fs(const struct statfs *s) {
            is_fs_type(s, RAMFS_MAGIC);
 }
 
+#if 0 /// UNNEEDED by elogind
 int fd_is_temporary_fs(int fd) {
         struct statfs s;
 
@@ -233,3 +234,14 @@ int fd_is_temporary_fs(int fd) {
 
         return is_temporary_fs(&s);
 }
+
+int path_is_temporary_fs(const char *path) {
+        _cleanup_close_ int fd = -1;
+
+        fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH);
+        if (fd < 0)
+                return -errno;
+
+        return fd_is_temporary_fs(fd);
+}
+#endif // 0