From 7143128324fc7bdee872855da9a34f2764a8051b Mon Sep 17 00:00:00 2001 From: "ziemowit.leszczynski" Date: Wed, 21 Aug 2024 12:46:35 +0200 Subject: [PATCH] unix: fix socket flags Sockets can read and write by default. Required for fdopen() to work on unix sockets. JIRA: RTOS-892 --- posix/unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;