* 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.
This commit is contained in:
Corinna Vinschen 2000-10-24 18:15:25 +00:00
parent 902047f40e
commit 90bb77ddcb
4 changed files with 18 additions and 10 deletions

View File

@ -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

View File

@ -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;

View File

@ -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.

View File

@ -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;