From b9e12d7c23888d55c1fa3e4c5f2bc5bdbe87b02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Sat, 13 Oct 2018 20:56:58 +0200 Subject: [PATCH] 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. --- repos/libports/src/lib/libc/socket_fs_plugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/libports/src/lib/libc/socket_fs_plugin.cc b/repos/libports/src/lib/libc/socket_fs_plugin.cc index 24f21e76b..1f0a5784e 100644 --- a/repos/libports/src/lib/libc/socket_fs_plugin.cc +++ b/repos/libports/src/lib/libc/socket_fs_plugin.cc @@ -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;