From 50eb798fa9198bf26d9fdad941c2f2166623c5ac Mon Sep 17 00:00:00 2001 From: jewelcodes Date: Fri, 6 Sep 2024 16:14:15 -0400 Subject: [PATCH] ipc: account for flags in socket() --- src/ipc/sockinit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ipc/sockinit.c b/src/ipc/sockinit.c index 75445bbd..62f9229f 100644 --- a/src/ipc/sockinit.c +++ b/src/ipc/sockinit.c @@ -65,6 +65,7 @@ int socket(Thread *t, int domain, int type, int protocol) { iod->type = IO_SOCKET; iod->data = calloc(1, sizeof(SocketDescriptor)); + iod->flags = type & 0xFF00; if(!iod->data) { releaseLock(&lock); closeIO(p, iod); @@ -73,7 +74,7 @@ int socket(Thread *t, int domain, int type, int protocol) { // set up the socket family for now SocketDescriptor *sock = (SocketDescriptor *)iod->data; sock->address.sa_family = domain; - sock->type = type; + sock->type = type & 0xFF; sock->protocol = protocol; sockets[socketCount] = sock;