Skip to content

Commit

Permalink
ipc: account for flags in socket()
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Sep 6, 2024
1 parent f861a3f commit 50eb798
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ipc/sockinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 50eb798

Please sign in to comment.