diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-08-16 14:46:23 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-08-16 14:46:23 +0000 |
commit | 29fec364c0ccf362af6cc232dbc2f3cbf3ec877e (patch) | |
tree | 6bbe10c420a48132dd90bc8ca1e9f5fb3fe2be6c | |
parent | dec9daad4a6b6f5f705f8e637d21e9e035d08218 (diff) | |
download | newlib-29fec364c0ccf362af6cc232dbc2f3cbf3ec877e.zip newlib-29fec364c0ccf362af6cc232dbc2f3cbf3ec877e.tar.gz newlib-29fec364c0ccf362af6cc232dbc2f3cbf3ec877e.tar.bz2 |
* dir.cc (readdir_worker): Convert w32name to PUNICODE_STRING.
* sec_acl.cc (getacl): Convert debug output to print native NT path.
* security.cc (set_file_attribute): Ditto.
* syscalls.cc (try_to_bin): Ditto and fix buggy debug statement.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/dir.cc | 11 | ||||
-rw-r--r-- | winsup/cygwin/sec_acl.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 4 |
5 files changed, 18 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9f36db5..7f95f16 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2007-08-16 Corinna Vinschen <corinna@vinschen.de> + * dir.cc (readdir_worker): Convert w32name to PUNICODE_STRING. + * sec_acl.cc (getacl): Convert debug output to print native NT path. + * security.cc (set_file_attribute): Ditto. + * syscalls.cc (try_to_bin): Ditto and fix buggy debug statement. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + * ntdll.h (RtlAcquirePebLock): Declare. (RtlReleasePebLock): Declare. * path.cc (cwdstuff::set): Change PEB only while it's locked. diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index 72d6ac1..c1f325e 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -140,14 +140,15 @@ readdir_worker (DIR *dir, dirent *de) de->d_ino = ((fhandler_base *) dir->__fh)->get_namehash (); if (!is_dot && !is_dot_dot) { - const char *w32name = ((fhandler_base *) dir->__fh)->get_win32_name (); + PUNICODE_STRING w32name = + ((fhandler_base *) dir->__fh)->pc.get_nt_native_path (); DWORD devn = ((fhandler_base *) dir->__fh)->get_device (); /* Paths below /proc don't have a Win32 pendant. */ if (isproc_dev (devn)) - de->d_ino = hash_path_name (de->d_ino, "/"); - /* A drive's root dir has a trailing backslash already. */ - else if (w32name[1] != ':' || w32name[2] != '\\' || w32name[3]) - de->d_ino = hash_path_name (de->d_ino, "\\"); + de->d_ino = hash_path_name (de->d_ino, L"/"); + else if (w32name->Buffer[w32name->Length / sizeof (WCHAR) - 1] + != L'\\') + de->d_ino = hash_path_name (de->d_ino, L"\\"); de->d_ino = hash_path_name (de->d_ino, de->d_name); } } diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index bd967f3..4ba5a2c 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -391,7 +391,7 @@ getacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp) aclbufp[i].a_perm &= ~(DENY_R | DENY_W | DENY_X); aclsort32 (pos, 0, aclbufp); } - syscall_printf ("%d = getacl (%s)", pos, pc.get_win32 ()); + syscall_printf ("%d = getacl (%S)", pos, pc.get_nt_native_path ()); return pos; } diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index daf2861..e4c82d5 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -715,8 +715,8 @@ set_file_attribute (HANDLE handle, path_conv &pc, } else ret = 0; - syscall_printf ("%d = set_file_attribute (%s, %d, %d, %p)", - ret, pc.get_win32 (), uid, gid, attribute); + syscall_printf ("%d = set_file_attribute (%S, %d, %d, %p)", + ret, pc.get_nt_native_path (), uid, gid, attribute); return ret; } diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 8e1c979..63df37e 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -358,8 +358,8 @@ try_to_bin (path_conv &win32_path, HANDLE h) FileRenameInformation); } if (!NT_SUCCESS (status)) - debug_printf ("Move %s to %s failed, status = %p", win32_path.get_win32 (), - recycler, status); + debug_printf ("Move %S to %S failed, status = %p", + win32_path.get_nt_native_path (), &recycler, status); out: if (rootdir) NtClose (rootdir); |