Index: fhandler.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler.cc,v retrieving revision 1.64 diff -u -p -2 -r1.64 fhandler.cc --- fhandler.cc 2001/06/05 09:21:39 1.64 +++ fhandler.cc 2001/06/14 07:09:07 @@ -309,5 +309,9 @@ fhandler_base::open (int flags, mode_t m } - if (get_device () == FH_TAPE) + if (get_query_open ()) + { + access = 0; + } + else if (get_device () == FH_TAPE) { access = GENERIC_READ | GENERIC_WRITE; Index: fhandler.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler.h,v retrieving revision 1.62 diff -u -p -2 -r1.62 fhandler.h --- fhandler.h 2001/05/31 05:25:46 1.62 +++ fhandler.h 2001/06/14 07:09:08 @@ -51,28 +51,30 @@ details. */ enum { - FH_RBINARY = 0x00001000, /* binary read mode */ - FH_WBINARY = 0x00002000, /* binary write mode */ - FH_CLOEXEC = 0x00004000, /* close-on-exec */ - FH_RBINSET = 0x00008000, /* binary read mode has been explicitly set */ - FH_WBINSET = 0x00010000, /* binary write mode has been explicitly set */ - FH_APPEND = 0x00020000, /* always append */ - FH_ASYNC = 0x00040000, /* async I/O */ - FH_HADEOF = 0x00080000, /* EOF seen */ + FH_RBINARY = 0x00001000, /* binary read mode */ + FH_WBINARY = 0x00002000, /* binary write mode */ + FH_CLOEXEC = 0x00004000, /* close-on-exec */ + FH_RBINSET = 0x00008000, /* binary read mode has been explicitly set */ + FH_WBINSET = 0x00010000, /* binary write mode has been explicitly set */ + FH_APPEND = 0x00020000, /* always append */ + FH_ASYNC = 0x00040000, /* async I/O */ + FH_HADEOF = 0x00080000, /* EOF seen */ - FH_SYMLINK = 0x00100000, /* is a symlink */ - FH_EXECABL = 0x00200000, /* file looked like it would run: + FH_SYMLINK = 0x00100000, /* is a symlink */ + FH_EXECABL = 0x00200000, /* file looked like it would run: * ends in .exe or .bat or begins with #! */ - FH_W95LSBUG= 0x00400000, /* set when lseek is called as a flag that + FH_W95LSBUG = 0x00400000, /* set when lseek is called as a flag that * _write should check if we've moved beyond * EOF, zero filling if so. */ - FH_NOFRNAME= 0x00800000, /* Set if shouldn't free unix_path_name and + FH_NOFRNAME = 0x00800000, /* Set if shouldn't free unix_path_name and windows_path_name_ on destruction. */ - FH_NOEINTR = 0x01000000, /* Set if I/O should be uninterruptible. */ - FH_FFIXUP = 0x02000000, /* Set if need to fixup after fork. */ - FH_LOCAL = 0x04000000, /* File is unix domain socket */ - FH_FIFO = 0x08000000, /* File is FIFO */ - FH_ISREMOTE= 0x10000000, /* File is on a remote drive */ - FH_DCEXEC = 0x20000000, /* Don't care if this is executable */ - FH_HASACLS = 0x40000000, /* True if fs of file has ACLS */ + FH_NOEINTR = 0x01000000, /* Set if I/O should be uninterruptible. */ + FH_FFIXUP = 0x02000000, /* Set if need to fixup after fork. */ + FH_LOCAL = 0x04000000, /* File is unix domain socket */ + FH_FIFO = 0x08000000, /* File is FIFO */ + FH_ISREMOTE = 0x10000000, /* File is on a remote drive */ + FH_DCEXEC = 0x20000000, /* Don't care if this is executable */ + FH_HASACLS = 0x40000000, /* True if fs of file has ACLS */ + FH_QUERYOPEN = 0x80000000, /* open file without requesting either read + or write access */ /* Device flags */ @@ -252,4 +254,7 @@ public: void set_append_p (int val) { FHCONDSETF (val, APPEND); } void set_append_p () { FHSETF (APPEND); } + + int get_query_open () { return FHISSETF (QUERYOPEN); } + void set_query_open (int val) { FHCONDSETF (val, QUERYOPEN); } int get_readahead_valid () { return raixget < ralen; } Index: syscalls.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/syscalls.cc,v retrieving revision 1.121 diff -u -p -2 -r1.121 syscalls.cc --- syscalls.cc 2001/06/09 21:25:55 1.121 +++ syscalls.cc 2001/06/14 07:09:08 @@ -1049,4 +1049,5 @@ stat_worker (const char *caller, const c && dtype != DRIVE_UNKNOWN))) { + fh.set_query_open (TRUE); oret = fh.open (real_path, O_RDONLY | O_BINARY | O_DIROPEN | (nofollow ? O_NOSYMLINK : 0), 0);