diff --git a/posix/unix.c b/posix/unix.c index 5e19ac366..8873ece09 100644 --- a/posix/unix.c +++ b/posix/unix.c @@ -959,7 +959,10 @@ int unix_getfl(unsigned socket) if ((s = unixsock_get(socket)) == NULL) return -ENOTSOCK; - flags = s->nonblock ? O_NONBLOCK : 0; + flags = O_RDWR; + if (s->nonblock) { + flags |= O_NONBLOCK; + } unixsock_put(s); return flags;