From dd4afee4a8ea8c44126c44b31c6f1a36582d0964 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 9 Dec 2020 18:27:43 +0000 Subject: Get rid of webipc.h --- src/conn-tools/s6-ipcserver-socketbinder.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/conn-tools/s6-ipcserver-socketbinder.c') diff --git a/src/conn-tools/s6-ipcserver-socketbinder.c b/src/conn-tools/s6-ipcserver-socketbinder.c index f5abf67..ce63830 100644 --- a/src/conn-tools/s6-ipcserver-socketbinder.c +++ b/src/conn-tools/s6-ipcserver-socketbinder.c @@ -1,14 +1,15 @@ /* ISC license. */ +#include #include #include #include +#include #include #include #include -#include -#include +#include #include #define USAGE "s6-ipcserver-socketbinder [ -d | -D ] [ -b backlog ] [ -M | -m ] [ -a perms ] [ -B ] path prog..." @@ -19,7 +20,7 @@ int main (int argc, char const *const *argv) unsigned int backlog = SOMAXCONN ; int flagreuse = 1 ; int flagdgram = 0 ; - int flagblocking = 0 ; + unsigned int flags = O_NONBLOCK ; unsigned int perms = 0777 ; PROG = "s6-ipcserver-socketbinder" ; { @@ -34,7 +35,7 @@ int main (int argc, char const *const *argv) case 'd' : flagreuse = 1 ; break ; case 'M' : flagdgram = 0 ; break ; case 'm' : flagdgram = 1 ; break ; - case 'B' : flagblocking = 1 ; break ; + case 'B' : flags = 0 ; break ; case 'b' : if (!uint0_scan(l.arg, &backlog)) dieusage() ; break ; case 'a' : if (!uint0_oscan(l.arg, &perms)) dieusage() ; break ; default : dieusage() ; @@ -44,7 +45,7 @@ int main (int argc, char const *const *argv) } if (argc < 2) dieusage() ; close(0) ; - if (flagdgram ? ipc_datagram_internal(flagblocking ? 0 : DJBUNIX_FLAG_NB) : ipc_stream_internal(flagblocking ? 0 : DJBUNIX_FLAG_NB)) + if (flagdgram ? ipc_datagram_internal(flags) : ipc_stream_internal(flags)) strerr_diefu1sys(111, "create socket") ; { -- cgit v1.2.3