diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-09-21 20:32:22 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-09-21 20:32:22 +0400 |
commit | 4c9d01fdad2acbfb5d0594dbe5fb6f0f402cff72 (patch) | |
tree | a8b522f688140bb24462bc8e0c8790aba434b7c5 /winsup/cygwin/fhandler_disk_file.cc | |
parent | 7ba1698ed99abca171d2beb9091168e20cdd8b34 (diff) |
* 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/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index cff345d31..6a28ac15c 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -636,13 +636,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf, file. Either the file is not opened for reading, or the read will change the file position. */ OBJECT_ATTRIBUTES attr; - if (pc.fs_is_nwfs ()) - InitializeObjectAttributes (&attr, pc.get_nt_native_path (), - OBJ_CASE_INSENSITIVE, - NULL, NULL) - else - InitializeObjectAttributes (&attr, &ro_u_empty, 0, - get_handle (), NULL); + pc.init_reopen_attr (&attr, h); status = NtOpenFile (&h, SYNCHRONIZE | FILE_READ_DATA, &attr, &io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT @@ -874,7 +868,7 @@ fhandler_disk_file::fchmod (mode_t mode) OBJECT_ATTRIBUTES attr; HANDLE fh; - InitializeObjectAttributes (&attr, &ro_u_empty, 0, get_handle (), NULL); + pc.init_reopen_attr (&attr, get_handle ()); if (NT_SUCCESS (NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES, &attr, &io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT))) @@ -1353,7 +1347,7 @@ fhandler_base::utimens_fs (const struct timespec *tvp) OBJECT_ATTRIBUTES attr; HANDLE fh; - InitializeObjectAttributes (&attr, &ro_u_empty, 0, get_handle (), NULL); + pc.init_reopen_attr (&attr, get_handle ()); if (NT_SUCCESS (NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES, &attr, &io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT))) @@ -2157,8 +2151,7 @@ fhandler_disk_file::rewinddir (DIR *dir) IO_STATUS_BLOCK io; HANDLE new_dir; - InitializeObjectAttributes (&attr, &ro_u_empty, pc.objcaseinsensitive (), - get_handle (), NULL); + pc.init_reopen_attr (&attr, get_handle ()); status = NtOpenFile (&new_dir, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io, FILE_SHARE_VALID_FLAGS, FILE_SYNCHRONOUS_IO_NONALERT |