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.
This commit is contained in:
Lennart Poettering
2018-01-05 13:55:08 +01:00
parent 7c59ab4ba1
commit 665dfe9318
6 changed files with 24 additions and 8 deletions
+1 -1
View File
@@ -316,7 +316,7 @@ int ask_password_tty(
}
if (notify >= 0 && pollfd[POLL_INOTIFY].revents != 0)
flush_fd(notify);
(void) flush_fd(notify);
if (pollfd[POLL_TTY].revents == 0)
continue;