diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-02-14 17:21:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-02-14 17:27:14 +0100 |
commit | a9dac7a6dd31225dbe9633061dcade12c0c90a32 (patch) | |
tree | 9fdf4d4480ecc18aa7306f8eddce2d9f5a8649d3 /src/libsystemd/sd-daemon/sd-daemon.c | |
parent | 38db6211b5aa6e2fb65883ae3353914e82f5bef1 (diff) | |
download | systemd-a9dac7a6dd31225dbe9633061dcade12c0c90a32.tar.gz |
tree-wide: port various places over to new stat_inode_same() helper
Diffstat (limited to 'src/libsystemd/sd-daemon/sd-daemon.c')
-rw-r--r-- | src/libsystemd/sd-daemon/sd-daemon.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index b373c173c1..b5f62ec5e8 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -23,6 +23,7 @@ #include "path-util.h" #include "process-util.h" #include "socket-util.h" +#include "stat-util.h" #include "strv.h" #include "time-util.h" #include "util.h" @@ -150,9 +151,7 @@ _public_ int sd_is_fifo(int fd, const char *path) { return -errno; } - return - st_path.st_dev == st_fd.st_dev && - st_path.st_ino == st_fd.st_ino; + return stat_inode_same(&st_path, &st_fd); } return 1; @@ -181,9 +180,7 @@ _public_ int sd_is_special(int fd, const char *path) { } if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) - return - st_path.st_dev == st_fd.st_dev && - st_path.st_ino == st_fd.st_ino; + return stat_inode_same(&st_path, &st_fd); else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) return st_path.st_rdev == st_fd.st_rdev; else @@ -429,8 +426,7 @@ _public_ int sd_is_mq(int fd, const char *path) { if (stat(fpath, &b) < 0) return -errno; - if (a.st_dev != b.st_dev || - a.st_ino != b.st_ino) + if (!stat_inode_same(&a, &b)) return 0; } |