diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-10-24 18:15:25 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-10-24 18:15:25 +0000 |
commit | 90bb77ddcb94446768b3a6d5be35bad3f63c69df (patch) | |
tree | 62b3dcc1f518c72e6bc844c39530fe81e6923362 | |
parent | 902047f40e05387306ddb85c7d4e2c75ce56952c (diff) | |
download | cygnal-90bb77ddcb94446768b3a6d5be35bad3f63c69df.tar.gz cygnal-90bb77ddcb94446768b3a6d5be35bad3f63c69df.tar.bz2 cygnal-90bb77ddcb94446768b3a6d5be35bad3f63c69df.zip |
* fhandler.cc (fhandler_base::fcntl): Behave properly when passed
previous version of O_NDELAY.
* syscalls.cc: Move OLD_O_NDELAY to winsup.h.
* winsup.h: Define OLD_O_NDELAY now.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 11 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/winsup.h | 5 |
4 files changed, 18 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5568069a5..b95b5d774 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +Tue Oct 24 20:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fcntl): Behave properly when passed + previous version of O_NDELAY. + * syscalls.cc: Move OLD_O_NDELAY to winsup.h. + * winsup.h: Define OLD_O_NDELAY now. + Mon Oct 23 21:47:55 2000 Christopher Faylor <cgf@cygnus.com> * exceptions.cc (signal_exit): Kill any executing child process if diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index c3970c803..abeef9e55 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1012,20 +1012,21 @@ int fhandler_base::fcntl (int cmd, void *arg) break; case F_GETFL: res = get_flags (); + debug_printf ("GETFL: %d", res); break; case F_SETFL: { /* - * Only O_APPEND, O_ASYNC and O_NONBLOCK are allowed. + * Only O_APPEND, O_ASYNC and O_NONBLOCK/O_NDELAY 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); + const int allowed_flags = O_APPEND | O_NONBLOCK | OLD_O_NDELAY; + + int flags = get_flags () & ~allowed_flags; + set_flags (flags | ((int)arg & allowed_flags)); } res = 0; break; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index adbe286a7..ea360a0c1 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -37,11 +37,6 @@ details. */ #include "perprocess.h" #include "security.h" -/* newlib used to define O_NDELAY differently from O_NONBLOCK. Now it - properly defines both to be the same. Unfortunately, we have to - behave properly the old version, too, to accomodate older executables. */ -#define OLD_O_NDELAY 4 - extern BOOL allow_ntsec; /* Close all files and process any queued deletions. diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index f308d6de3..dbbcb620e 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -252,6 +252,11 @@ extern void (*__DTOR_LIST__) (void); #define O_NOSYMLINK 0x080000 #define O_DIROPEN 0x100000 +/* newlib used to define O_NDELAY differently from O_NONBLOCK. Now it + properly defines both to be the same. Unfortunately, we have to + behave properly the old version, too, to accomodate older executables. */ +#define OLD_O_NDELAY 4 + /* The title on program start. */ extern char *old_title; extern BOOL display_title; |