diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-05-21 21:06:34 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2021-05-21 21:06:34 +0000 |
commit | b7c8979175f313314acec906577c54d48a8c6688 (patch) | |
tree | cab4c83745b4583365f9b2b2e4c95181534b2f32 | |
parent | 91130797f3267a4fe26cadd786ab4dca122eaa5f (diff) | |
download | s6-networking-b7c8979175f313314acec906577c54d48a8c6688.tar.xz |
Trivial syscall number optimization
-rw-r--r-- | src/conn-tools/s6-tcpserver4d.c | 2 | ||||
-rw-r--r-- | src/conn-tools/s6-tcpserver6d.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/conn-tools/s6-tcpserver4d.c b/src/conn-tools/s6-tcpserver4d.c index 851058d..6165d2f 100644 --- a/src/conn-tools/s6-tcpserver4d.c +++ b/src/conn-tools/s6-tcpserver4d.c @@ -223,7 +223,7 @@ static inline void run_child (int s, uint32_t ip, uint16_t port, unsigned int nu char fmt[74] ; size_t n = 0 ; PROG = "s6-tcpserver (child)" ; - if ((fd_move(0, s) < 0) || (fd_copy(1, 0) < 0)) + if ((fd_move(1, s) < 0) || (fd_copy(0, 1) < 0)) strerr_diefu1sys(111, "move fds") ; memcpy(fmt+n, "PROTO=TCP\0TCPREMOTEIP=", 22) ; n += 22 ; n += ip4_fmtu32(fmt+n, ip) ; fmt[n++] = 0 ; diff --git a/src/conn-tools/s6-tcpserver6d.c b/src/conn-tools/s6-tcpserver6d.c index e769ab1..57b4a9b 100644 --- a/src/conn-tools/s6-tcpserver6d.c +++ b/src/conn-tools/s6-tcpserver6d.c @@ -229,7 +229,7 @@ static inline void run_child (int s, char const *ip, uint16_t port, unsigned int char fmt[98] ; size_t n = 0 ; PROG = "s6-tcpserver6 (child)" ; - if ((fd_move(0, s) < 0) || (fd_copy(1, 0) < 0)) + if ((fd_move(1, s) < 0) || (fd_copy(0, 1) < 0)) strerr_diefu1sys(111, "move fds") ; memcpy(fmt+n, "PROTO=TCP\0TCPREMOTEIP=", 22) ; n += 22 ; n += ip6_fmt(fmt+n, ip) ; fmt[n++] = 0 ; |