Skip to content

Commit 83cc95a

Browse files
committed
src/lib/socket.c: Assume natural state of newly created socket is all flags off
1 parent d1a8399 commit 83cc95a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,8 @@ int so_socket(int domain, int type, const struct so_options *opts, int *_error)
694694
if (-1 == (fd = socket(domain, type, 0)))
695695
goto syerr;
696696

697-
if ((error = so_setfl(fd, flags, mask, need)))
697+
/* assumes natural state of socket is all flags off */
698+
if ((error = so_setfl(fd, flags, mask&flags, need)))
698699
goto error;
699700

700701
return fd;

0 commit comments

Comments
 (0)