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-24 00:29:31 +0400
committerCorinna Vinschen <corinna@vinschen.de>2000-10-24 00:29:31 +0400
commit38a17986453e32c9801da519f0e857e067a46dd7 (patch)
tree644e5528e79ab06aa4cda149f6c568f8b85d1687 /winsup/cygwin/fhandler.cc
parent1eb14bae8cc488dad2da4925cb73e4376c69fe45 (diff)
* fhandler.cc (fhandler_base::fcntl): Setting flags in F_SETFL
branch according to Linux documentation.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 8e6c33161..c3970c803 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1001,8 +1001,6 @@ int fhandler_base::fcntl (int cmd, void *arg)
{
int res;
- /*int temp = 0;*/
-
switch (cmd)
{
case F_GETFD:
@@ -1016,16 +1014,19 @@ int fhandler_base::fcntl (int cmd, void *arg)
res = get_flags ();
break;
case F_SETFL:
- /* Only O_APPEND, O_NONBLOCK and O_ASYNC may be set. */
- /*
- if (arg & O_RDONLY)
- temp |= GENERIC_READ;
- if (arg & O_WRONLY)
- temp |= GENERIC_WRITE;
- syscall_printf ("fcntl (F_SETFL, %d)", (int) arg);
- set_access (temp);
- */
- set_flags ((int) arg);
+ {
+ /*
+ * Only O_APPEND, O_ASYNC and O_NONBLOCK are allowed.
+ * 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...
+ */
+ int flags = get_flags ();
+ flags &= ~(O_APPEND | O_NONBLOCK);
+ flags |= ((int) arg & (O_APPEND | O_NONBLOCK));
+ set_flags (flags);
+ }
res = 0;
break;
case F_GETLK: