summaryrefslogtreecommitdiffstats
path: root/src/machine/machined-dbus.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-10-18 06:52:47 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-10-19 11:31:44 +0200
commit86cbbc6d052bc3cc97aa2ece58603a9939f9ee6a (patch)
tree6186d2df19cd787bdc5530462ee063fe8cff8cbc /src/machine/machined-dbus.c
parentfuzz: unify logging setup (diff)
downloadsystemd-86cbbc6d052bc3cc97aa2ece58603a9939f9ee6a.tar.xz
systemd-86cbbc6d052bc3cc97aa2ece58603a9939f9ee6a.zip
tree-wide: check if return value of lseek() and friends is negative
We usually check return value of syscalls or glibc functions by it is negative or not, something like that `if (stat(path, &st) < 0)`. Let's also use the same style for lseek() and friends even the type of their return value is off_t. Note, fseeko() returns int, instead of off_t.
Diffstat (limited to 'src/machine/machined-dbus.c')
-rw-r--r--src/machine/machined-dbus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 979eb3cee7..a12eb516cc 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -613,7 +613,7 @@ static int clean_pool_done(Operation *operation, int ret, sd_bus_error *error) {
assert(operation);
assert(operation->extra_fd >= 0);
- if (lseek(operation->extra_fd, 0, SEEK_SET) == (off_t) -1)
+ if (lseek(operation->extra_fd, 0, SEEK_SET) < 0)
return -errno;
f = take_fdopen(&operation->extra_fd, "r");