From 2db563ebdd1eb095317acb41ee645f55cb5a59c7 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 6 Oct 2014 15:37:46 +0200 Subject: [PATCH] libc_lwip: 'fcntl()' fix Fixes #1273 --- repos/libports/src/lib/libc_lwip/plugin.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/repos/libports/src/lib/libc_lwip/plugin.cc b/repos/libports/src/lib/libc_lwip/plugin.cc index e70d96eb3b..ab30b20ebc 100644 --- a/repos/libports/src/lib/libc_lwip/plugin.cc +++ b/repos/libports/src/lib/libc_lwip/plugin.cc @@ -321,7 +321,11 @@ int Plugin::fcntl(Libc::File_descriptor *sockfdo, int cmd, long val) switch (cmd) { case F_GETFL: case F_SETFL: - result = lwip_fcntl(s, cmd, (val & O_NONBLOCK) ? -1 : O_NONBLOCK); + /* + * lwip_fcntl() supports only the 'O_NONBLOCK' flag and only if + * no other flag is set. + */ + result = lwip_fcntl(s, cmd, val & O_NONBLOCK); break; default: PERR("unsupported fcntl() request: %d", cmd);