diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-12 23:21:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-05 13:55:08 +0100 |
commit | 665dfe93185a1decdb422f9e5b65a7e39415f129 (patch) | |
tree | 266e268f0345f01e13ffd9b46800beba172f73c1 /src/libsystemd | |
parent | install: search preset files in /run (#7715) (diff) | |
download | systemd-665dfe93185a1decdb422f9e5b65a7e39415f129.tar.xz systemd-665dfe93185a1decdb422f9e5b65a7e39415f129.zip |
io-util: make flush_fd() return how many bytes where flushed
This is useful so that callers know whether anything at all and how much
was flushed.
This patches through users of this functions to ensure that the return
values > 0 which may be returned now are not propagated in public APIs.
Also, users that ignore the return value are changed to do so explicitly
now.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-login/sd-login.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index e8adaa6823..69572d1a51 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -1061,10 +1061,15 @@ _public_ sd_login_monitor* sd_login_monitor_unref(sd_login_monitor *m) { } _public_ int sd_login_monitor_flush(sd_login_monitor *m) { + int r; assert_return(m, -EINVAL); - return flush_fd(MONITOR_TO_FD(m)); + r = flush_fd(MONITOR_TO_FD(m)); + if (r < 0) + return r; + + return 0; } _public_ int sd_login_monitor_get_fd(sd_login_monitor *m) { |