From 5b312b4747cc4acda39c187369c02fcea456513b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 31 Oct 2013 14:26:42 +0000 Subject: * devices.in (dev_cygdrive_storage): Revert mapping to \Device\Null. (dev_storage): Ditto for /dev. * devices.cc: Regenerate. * fhandler.cc (fhandler_base::open_null): New method to open a fake \Device\Null handler. (fhandler_base::open): Fix formatting. Change O_ACCMODE test to a switch statement. Simplify a test which still tested for a now unused create_disposition. * fhandler.h (fhandler_base::open_null): Declare. (fhandler_netdrive::close): Declare. * fhandler_dev.cc (fhandler_dev::open): Open fake \Device\Null handle by just calling new open_null method. * fhandler_disk_file.cc (fhandler_cygdrive::open): Ditto. * fhandler_netdrive.cc (fhandler_netdrive::open): Call open_null rather than setting nohandle. (fhandler_netdrive::close): New method. * fhandler_registry.cc (fetch_hkey): Fix token in RegOpenUserClassesRoot call. Create valid key for HKEY_CURRENT_CONFIG by mapping to real key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current. (fhandler_registry::open): Set nohandle only when using pseudo registry handle. * fhandler_virtual.cc (fhandler_virtual::opendir): Call open rather than just setting nohandle here. * fhandler_virtual::fstatvfs): Set ST_RDONLY fs flag. * globals.cc (ro_u_null): New readonly UNICODE_STRING for \Device\Null. * path.h (path_conv::set_path): Revert previous change caring for wide_path. --- winsup/cygwin/fhandler.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index d2f9758d8..d63e7448f 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -310,6 +310,7 @@ class fhandler_base virtual bool need_fixup_before () const {return false;} int open_with_arch (int, mode_t = 0); + int open_null (int flags); virtual int open (int, mode_t); virtual void open_setup (int flags); void set_unique_id () { NtAllocateLocallyUniqueId ((PLUID) &unique_id); } @@ -1962,6 +1963,7 @@ class fhandler_netdrive: public fhandler_virtual void rewinddir (DIR *); int closedir (DIR *); int open (int flags, mode_t mode = 0); + int close (); int __reg2 fstat (struct stat *buf); fhandler_netdrive (void *) {} -- cgit v1.2.3