diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-23 15:11:08 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-23 15:11:08 +0200 |
commit | 644cb4cc7ac550242bfb65b6742d3bffb07d60e8 (patch) | |
tree | 6bb3f6a06776fb966a2e31be74de09e231f9e9d4 /src/basic/socket-util.c | |
parent | f5f899ef044e4b159e723b273ff35fda935f6427 (diff) | |
download | systemd-644cb4cc7ac550242bfb65b6742d3bffb07d60e8.tar.gz |
basic/socket-util: fix typo and reword comment
Comment bike-shedding might be the ultimate form of procrastination, but
I can't stop myself. :)
Diffstat (limited to 'src/basic/socket-util.c')
-rw-r--r-- | src/basic/socket-util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index e787d53d8f..cf2e08c2df 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -1228,18 +1228,18 @@ int flush_accept(int fd) { int r, b; socklen_t l = sizeof(b); - /* Similar to flush_fd() but flushes all incoming connection by accepting them and immediately - * closing them. */ + /* Similar to flush_fd() but flushes all incoming connections by accepting and immediately closing + * them. */ if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &b, &l) < 0) return -errno; assert(l == sizeof(b)); - if (!b) /* Let's check if this is a socket accepting connections before calling accept(). That's - * because accept4() can return EOPNOTSUPP in the fd we are called on is not a listening - * socket, or in case the incoming TCP connection transiently triggered that (see accept(2) - * man page for details). The latter case is a transient error we should continue looping - * on. The former case however is fatal. */ + if (!b) /* Let's check if this socket accepts connections before calling accept(). accept4() can + * return EOPNOTSUPP if the fd is not a listening socket, which we should treat as a fatal + * error, or in case the incoming TCP connection triggered a network issue, which we want to + * treat as a transient error. Thus, let's rule out the first reason for EOPNOTSUPP early, so + * we can loop safely on transient errors below. */ return -ENOTTY; for (;;) { |