about summary refs log tree commit diff
path: root/shared/systemd/src/basic/stat-util.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2021-02-25 11:36:45 +0100
committerSebastien Bacher <seb128@ubuntu.com>2021-02-25 11:36:45 +0100
commitd92aa7f298fe84d4cf686c5ad64b73438e00d377 (patch)
tree2f1f4c7b48cff9e63b0d0e3669bada3d9aeda72e /shared/systemd/src/basic/stat-util.c
parenta82e048a943092315a32d745c99e0f5635e29134 (diff)
parent3a56bce6c0ea7ba0fe269520547740783b342e0d (diff)
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'shared/systemd/src/basic/stat-util.c')
-rw-r--r--shared/systemd/src/basic/stat-util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shared/systemd/src/basic/stat-util.c b/shared/systemd/src/basic/stat-util.c
index 6d393041..a9880096 100644
--- a/shared/systemd/src/basic/stat-util.c
+++ b/shared/systemd/src/basic/stat-util.c
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "nm-sd-adapt-shared.h"
 
@@ -231,13 +231,12 @@ int fd_is_network_fs(int fd) {
 }
 
 int path_is_temporary_fs(const char *path) {
-        _cleanup_close_ int fd = -1;
+        struct statfs s;
 
-        fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH);
-        if (fd < 0)
+        if (statfs(path, &s) < 0)
                 return -errno;
 
-        return fd_is_temporary_fs(fd);
+        return is_temporary_fs(&s);
 }
 #endif /* NM_IGNORED */
 
@@ -415,7 +414,8 @@ bool stat_inode_unmodified(const struct stat *a, const struct stat *b) {
         return a && b &&
                 (a->st_mode & S_IFMT) != 0 && /* We use the check for .st_mode if the structure was ever initialized */
                 ((a->st_mode ^ b->st_mode) & S_IFMT) == 0 &&  /* same inode type */
-                a->st_mtime == b->st_mtime &&
+                a->st_mtim.tv_sec == b->st_mtim.tv_sec &&
+                a->st_mtim.tv_nsec == b->st_mtim.tv_nsec &&
                 (!S_ISREG(a->st_mode) || a->st_size == b->st_size) && /* if regular file, compare file size */
                 a->st_dev == b->st_dev &&
                 a->st_ino == b->st_ino &&