diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-09-13 13:48:02 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-09-13 13:48:02 +0000 |
commit | 3f369313bfd5c06b4a32f7304a49209b4c91de10 (patch) | |
tree | 1251f31630f0f6c2af4966cf3dc444968c2d5c6d | |
parent | 2b6b20aae8959985a42d100292aac3eca9198165 (diff) | |
download | s6-networking-3f369313bfd5c06b4a32f7304a49209b4c91de10.tar.xz |
bugfix: spurious error message in s6-tcpserver?d when maxed connections
-rw-r--r-- | src/conn-tools/s6-tcpserver-access.c | 3 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver4d.c | 6 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver6d.c | 5 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/conn-tools/s6-tcpserver-access.c b/src/conn-tools/s6-tcpserver-access.c index 720da7e..80360e5 100644 --- a/src/conn-tools/s6-tcpserver-access.c +++ b/src/conn-tools/s6-tcpserver-access.c @@ -228,7 +228,7 @@ int main (int argc, char const *const *argv, char const *const *envp) } else { - static tain_t const infinite = TAIN_INFINITE ; + tain_t infinite ; s6dns_dpag_t data[2] = { S6DNS_DPAG_ZERO, S6DNS_DPAG_ZERO } ; s6dns_resolve_t blob[2] ; char remotebuf[256] ; @@ -239,6 +239,7 @@ int main (int argc, char const *const *argv, char const *const *envp) memcpy(tcplocalhost + protolen, "LOCALHOST", 10) ; memcpy(tcpremotehost, proto, protolen) ; memcpy(tcpremotehost + protolen, "REMOTEHOST", 11) ; + tain_add_g(&infinite, &tain_infinite_relative) ; if (!s6dns_init()) { diff --git a/src/conn-tools/s6-tcpserver4d.c b/src/conn-tools/s6-tcpserver4d.c index 7579ea2..914e981 100644 --- a/src/conn-tools/s6-tcpserver4d.c +++ b/src/conn-tools/s6-tcpserver4d.c @@ -344,12 +344,12 @@ int main (int argc, char const *const *argv, char const *const *envp) pidip = pidip_inyostack ; ipnum = ipnum_inyostack ; while (cont) { - if (iopause_g(x, 1 + (numconn < maxconn), 0) < 0) - strerr_diefu1sys(111, "iopause") ; + int h = numconn < maxconn ; + if (iopause_g(x, 1 + h, 0) < 0) strerr_diefu1sys(111, "iopause") ; if (x[0].revents & IOPAUSE_EXCEPT) strerr_dief1x(111, "trouble with selfpipe") ; if (x[0].revents & IOPAUSE_READ) handle_signals() ; - if (numconn < maxconn) + if (h) { if (x[1].revents & IOPAUSE_EXCEPT) strerr_dief1x(111, "trouble with socket") ; if (x[1].revents & IOPAUSE_READ) diff --git a/src/conn-tools/s6-tcpserver6d.c b/src/conn-tools/s6-tcpserver6d.c index 85128e8..5a763b5 100644 --- a/src/conn-tools/s6-tcpserver6d.c +++ b/src/conn-tools/s6-tcpserver6d.c @@ -349,12 +349,13 @@ int main (int argc, char const *const *argv, char const *const *envp) while (cont) { - if (iopause_g(x, 1 + (numconn < maxconn), 0) < 0) + int h = numconn < maxconn ; + if (iopause_g(x, 1 + h, 0) < 0) strerr_diefu1sys(111, "iopause") ; if (x[0].revents & IOPAUSE_EXCEPT) strerr_dief1x(111, "trouble with selfpipe") ; if (x[0].revents & IOPAUSE_READ) handle_signals() ; - if (numconn < maxconn) + if (h) { if (x[1].revents & IOPAUSE_EXCEPT) strerr_dief1x(111, "trouble with socket") ; if (x[1].revents & IOPAUSE_READ) |