aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-10-20 19:30:06 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-10-20 19:30:06 +0000
commit669bdeb82236ed53f094702ec4af7d253d828df4 (patch)
tree581f6fbb9f9cca2ce4689f4c59857d3ff927e530 /winsup/cygwin/path.cc
parent87ab6bfb627d902150a73ef8f6f81f135e015224 (diff)
downloadnewlib-669bdeb82236ed53f094702ec4af7d253d828df4.zip
newlib-669bdeb82236ed53f094702ec4af7d253d828df4.tar.gz
newlib-669bdeb82236ed53f094702ec4af7d253d828df4.tar.bz2
* ntdll.h (NtSetAttributesFile): New inline function.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Use NtSetAttributesFile. * path.cc (symlink_worker): Ditto. * syscalls.cc (unlink_nt): Ditto. (rename): Omit FILE_SHARE_DELETE when opening files on Samba. Add comment to explain why.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 442e7bb..1f9028a 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1516,7 +1516,6 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
IO_STATUS_BLOCK io;
NTSTATUS status;
HANDLE fh;
- FILE_BASIC_INFORMATION fbi;
tmp_pathbuf tp;
/* POSIX says that empty 'newpath' is invalid input while empty
@@ -1741,11 +1740,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
__seterrno_from_nt_status (status);
goto done;
}
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart
- = fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = FILE_ATTRIBUTE_NORMAL;
- status = NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
+ status = NtSetAttributesFile (fh, FILE_ATTRIBUTE_NORMAL);
NtClose (fh);
if (!NT_SUCCESS (status))
{
@@ -1778,12 +1773,8 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym,
status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, cp - buf, NULL, NULL);
if (NT_SUCCESS (status) && io.Information == (ULONG) (cp - buf))
{
- fbi.CreationTime.QuadPart = fbi.LastAccessTime.QuadPart
- = fbi.LastWriteTime.QuadPart = fbi.ChangeTime.QuadPart = 0LL;
- fbi.FileAttributes = use_winsym ? FILE_ATTRIBUTE_READONLY
- : FILE_ATTRIBUTE_SYSTEM;
- status = NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
- FileBasicInformation);
+ status = NtSetAttributesFile (fh, use_winsym ? FILE_ATTRIBUTE_READONLY
+ : FILE_ATTRIBUTE_SYSTEM);
if (!NT_SUCCESS (status))
debug_printf ("Setting attributes failed, status = %p", status);
res = 0;