From b6de172b3545a73f6f31500ee9c4d51898fbe2bc Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 9 Dec 2020 18:30:22 +0000 Subject: Get rid of webipc.h --- src/conn-tools/s6-tcpserver4-socketbinder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/conn-tools/s6-tcpserver4-socketbinder.c') diff --git a/src/conn-tools/s6-tcpserver4-socketbinder.c b/src/conn-tools/s6-tcpserver4-socketbinder.c index a37fae1..c02c3a6 100644 --- a/src/conn-tools/s6-tcpserver4-socketbinder.c +++ b/src/conn-tools/s6-tcpserver4-socketbinder.c @@ -3,13 +3,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -21,7 +21,7 @@ int main (int argc, char const *const *argv) unsigned int backlog = SOMAXCONN ; int flagreuse = 1 ; int flagudp = 0 ; - int flagblocking = 0 ; + unsigned int flags = O_NONBLOCK ; char ip[4] ; uint16_t port ; PROG = "s6-tcpserver4-socketbinder" ; @@ -37,7 +37,7 @@ int main (int argc, char const *const *argv) case 'd' : flagreuse = 1 ; break ; case 'M' : flagudp = 0 ; break ; case 'm' : flagudp = 1 ; break ; - case 'B' : flagblocking = 1 ; break ; + case 'B' : flags = 0 ; break ; case 'b' : if (!uint0_scan(l.arg, &backlog)) dieusage() ; break ; default : dieusage() ; } @@ -47,7 +47,7 @@ int main (int argc, char const *const *argv) if (argc < 3) dieusage() ; if (!ip4_scan(argv[0], ip) || !uint160_scan(argv[1], &port)) dieusage() ; close(0) ; - if (flagudp ? socket_udp4_internal(flagblocking ? 0 : DJBUNIX_FLAG_NB) : socket_tcp4_internal(flagblocking ? 0 : DJBUNIX_FLAG_NB)) + if (flagudp ? socket_udp4_internal(flags) : socket_tcp4_internal(flags)) strerr_diefu1sys(111, "create socket") ; if ((flagreuse ? socket_bind4_reuse(0, ip, port) : socket_bind4(0, ip, port)) < 0) strerr_diefu5sys(111, "bind to ", argv[0], ":", argv[1], " ") ; -- cgit v1.2.3