summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-04-14 13:08:03 +0200
committerLennart Poettering <lennart@poettering.net>2023-04-14 13:15:39 +0200
commitd230d4770db1afe57503c3857d0c902aafcc074c (patch)
tree59a9ee17caf14e6877ffaec5b3931cef7464093f
parent524ea5852a7e6e85317ce4dd66877b7bcd11f982 (diff)
downloadsystemd-d230d4770db1afe57503c3857d0c902aafcc074c.tar.gz
mountpoint-util: use memcmp_nn() where appropriate
-rw-r--r--src/basic/mountpoint-util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
index 601776541b..484f1e1750 100644
--- a/src/basic/mountpoint-util.c
+++ b/src/basic/mountpoint-util.c
@@ -271,9 +271,9 @@ int fd_is_mount_point(int fd, const char *filename, int flags) {
/* If the file handle for the directory we are interested in and its parent are identical,
* we assume this is the root directory, which is a mount point. */
- if (h->handle_bytes == h_parent->handle_bytes &&
- h->handle_type == h_parent->handle_type &&
- memcmp(h->f_handle, h_parent->f_handle, h->handle_bytes) == 0)
+ if (h->handle_type == h_parent->handle_type &&
+ memcmp_nn(h->f_handle, h->handle_bytes,
+ h_parent->f_handle, h_parent->handle_bytes) == 0)
return 1;
return mount_id != mount_id_parent;