libc: always set O_RDWR in fcntl on a socket

For better or worse we have no proper way of handling this right now
but contrib libraries, e.g. glib, use it to determine if they can use
the underlying fd.

Fxies #3265.
This commit is contained in:
Josef Söntgen 2018-10-13 20:56:58 +02:00 committed by Christian Helmuth
parent 5af0162b3f
commit b9e12d7c23
1 changed files with 1 additions and 1 deletions

View File

@ -977,7 +977,7 @@ int Socket_fs::Plugin::fcntl(Libc::File_descriptor *fd, int cmd, long arg)
switch (cmd) {
case F_GETFL:
return context->fd_flags();
return context->fd_flags() | O_RDWR;
case F_SETFL:
context->fd_flags(arg);
return 0;