diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-05-08 21:09:35 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-05-08 21:09:35 +0200 |
commit | d75103d4c68f13ecf3d09234c1506d58e8fae80e (patch) | |
tree | d194cc46b63dc07129ee3bb20e9a87b7df93161a /src/basic/io-util.c | |
parent | 977f2beaf2d9c60c69d9dc5d86685bb2960a6a7d (diff) | |
parent | 60d9771c593e0702a892a4372443e63b38cdbcba (diff) |
Merge pull request #3202 from poettering/socket-fixes
don't reopen socket fds when reloading the daemon
Diffstat (limited to 'src/basic/io-util.c')
-rw-r--r-- | src/basic/io-util.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/io-util.c b/src/basic/io-util.c index 0037a37f2a..cc6dfa8c1b 100644 --- a/src/basic/io-util.c +++ b/src/basic/io-util.c @@ -33,6 +33,11 @@ int flush_fd(int fd) { .events = POLLIN, }; + /* Read from the specified file descriptor, until POLLIN is not set anymore, throwing away everything + * read. Note that some file descriptors (notable IP sockets) will trigger POLLIN even when no data can be read + * (due to IP packet checksum mismatches), hence this function is only safe to be non-blocking if the fd used + * was set to non-blocking too. */ + for (;;) { char buf[LINE_MAX]; ssize_t l; |