Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2000-10-25 12:47:23 +0400
committerCorinna Vinschen <corinna@vinschen.de>2000-10-25 12:47:23 +0400
commit2f7356f39bf87cd3b509cb1dc3cfafab086aaf58 (patch)
tree8f9244d774a96331840f171f031d5e916d805045 /winsup/cygwin/fhandler.cc
parentd220f0b21c2b466dde5442feeb915cf2561939a2 (diff)
* fhandler.cc (fhandler_base::fcntl): Treat O_NONBLOCK and OLD_O_NDELAY
as exactly the same. If one is set, both are set. * net.cc (fhandler_socket::fcntl): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index abeef9e55..811b03888 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1021,12 +1021,17 @@ int fhandler_base::fcntl (int cmd, void *arg)
* Each other flag will be ignored.
* Since O_ASYNC isn't defined in fcntl.h it's currently
* ignored as well.
- * There's no functionality at all, so...
*/
const int allowed_flags = O_APPEND | O_NONBLOCK | OLD_O_NDELAY;
+ /* Care for the old O_NDELAY flag. If one of the flags is set,
+ both flags are set. */
+ int new_flags = (int) arg;
+ if (new_flags & (O_NONBLOCK | OLD_O_NDELAY))
+ new_flags |= O_NONBLOCK | OLD_O_NDELAY;
+
int flags = get_flags () & ~allowed_flags;
- set_flags (flags | ((int)arg & allowed_flags));
+ set_flags (flags | (new_flags & allowed_flags));
}
res = 0;
break;