Skip to content

Commit

Permalink
unix: fix socket flags
Browse files Browse the repository at this point in the history
Sockets can read and write by default. Required for fdopen() to work on unix sockets.

JIRA: RTOS-892
  • Loading branch information
ziemleszcz committed Aug 21, 2024
1 parent fa2cb46 commit 7143128
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion posix/unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7143128

Please sign in to comment.