summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-09-21 16:32:22 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-09-21 16:32:22 +0000
commit4c9d01fdad2acbfb5d0594dbe5fb6f0f402cff72 (patch)
treea8b522f688140bb24462bc8e0c8790aba434b7c5 /winsup/cygwin/path.h
parent7ba1698ed99abca171d2beb9091168e20cdd8b34 (diff)
downloadcygnal-4c9d01fdad2acbfb5d0594dbe5fb6f0f402cff72.tar.gz
cygnal-4c9d01fdad2acbfb5d0594dbe5fb6f0f402cff72.tar.bz2
cygnal-4c9d01fdad2acbfb5d0594dbe5fb6f0f402cff72.zip
* mount.h (class fs_info): Add has_buggy_reopen flag and accessor
methods. * mount.cc (fs_info::update): Set has_buggy_reopen flag for NWFS. Add comment. * path.h (path_conv::get_object_attr) Make inline method. (path_conv::init_reopen_attr): New inline method. * path.cc (path_conv::get_object_attr): Remove. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use path_conv::init_reopen_attr method to initialize OBJECT_ATTRIBUTE for reopening file. (fhandler_disk_file::fchmod): Ditto. (fhandler_base::utimens_fs): Ditto. (fhandler_disk_file::rewinddir): Ditto. * syscalls.cc (unlink_nt): Ditto.
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r--winsup/cygwin/path.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index f832016e5..a53cf169a 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -158,6 +158,7 @@ class path_conv
int has_symlinks () const {return path_flags & PATH_HAS_SYMLINKS;}
int has_dos_filenames_only () const {return path_flags & PATH_DOS;}
int has_buggy_open () const {return fs.has_buggy_open ();}
+ int has_buggy_reopen () const {return fs.has_buggy_reopen ();}
int has_buggy_fileid_dirinfo () const {return fs.has_buggy_fileid_dirinfo ();}
int has_buggy_basic_info () const {return fs.has_buggy_basic_info ();}
int binmode () const
@@ -253,8 +254,26 @@ class path_conv
~path_conv ();
inline const char *get_win32 () { return path; }
PUNICODE_STRING get_nt_native_path ();
- POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &attr,
- SECURITY_ATTRIBUTES &sa);
+ inline POBJECT_ATTRIBUTES get_object_attr (OBJECT_ATTRIBUTES &attr,
+ SECURITY_ATTRIBUTES &sa)
+ {
+ if (!get_nt_native_path ())
+ return NULL;
+ InitializeObjectAttributes (&attr, &uni_path,
+ objcaseinsensitive ()
+ | (sa.bInheritHandle ? OBJ_INHERIT : 0),
+ NULL, sa.lpSecurityDescriptor);
+ return &attr;
+ }
+ inline void init_reopen_attr (POBJECT_ATTRIBUTES attr, HANDLE h)
+ {
+ if (has_buggy_reopen ())
+ InitializeObjectAttributes (attr, get_nt_native_path (),
+ objcaseinsensitive (), NULL, NULL)
+ else
+ InitializeObjectAttributes (attr, &ro_u_empty, objcaseinsensitive (),
+ h, NULL);
+ }
inline size_t get_wide_win32_path_len ()
{
get_nt_native_path ();