From 4a971ce403ee1dba9d779219310043816a4c4768 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 14 Aug 2007 14:48:52 +0000 Subject: * fhandler.h (fhandler_base::pc): Make public. * fhandler_disk_file.cc (fhandler_disk_file::link): Drop extern declaration of stat_suffixes. Use NT native path in debug output. (fhandler_base::utimes_fs): Simplify closeit case. Use close_fs to close newly opened file handle. (fhandler_base::open_fs): Use NT native path in debug output. * path.cc: Throughout drop extern declaration of stat_suffixes. * path.h (stat_suffixes): Declare. * sec_acl.cc (acl_worker): Drop extern declaration of stat_suffixes. * times.cc (utimes_worker): Take path_conv as parameter instead of single-byte pathnam, drop nofollow argument, accommodate throughout. Compare UNICODE paths when enumerating file descriptors. Fix formatting. Use NT native path in debug output. --- winsup/cygwin/fhandler_disk_file.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/fhandler_disk_file.cc') diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index cbbd0fd7b..945d398fd 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1050,7 +1050,6 @@ int fhandler_disk_file::link (const char *newpath) { extern bool allow_winsymlinks; - extern suffix_info stat_suffixes[]; path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_POSIX, transparent_exe ? stat_suffixes : NULL); @@ -1062,7 +1061,7 @@ fhandler_disk_file::link (const char *newpath) if (newpc.exists ()) { - syscall_printf ("file '%s' exists?", newpc.get_win32 ()); + syscall_printf ("file '%S' exists?", newpc.get_nt_native_path ()); set_errno (EEXIST); return -1; } @@ -1195,17 +1194,15 @@ fhandler_base::utimes_fs (const struct timeval *tvp) fbi.FileAttributes = 0; NTSTATUS status = NtSetInformationFile (get_handle (), &io, &fbi, sizeof fbi, FileBasicInformation); + if (closeit) + close_fs (); /* Opening a directory on a 9x share from a NT machine works(!), but then NtSetInformationFile fails with STATUS_NOT_SUPPORTED. Oh well... */ if (!NT_SUCCESS (status) && status != STATUS_NOT_SUPPORTED) { - if (closeit) - close (); __seterrno_from_nt_status (status); return -1; } - if (closeit) - close (); return 0; } @@ -1265,8 +1262,8 @@ fhandler_base::open_fs (int flags, mode_t mode) set_fs_flags (pc.fs_flags ()); out: - syscall_printf ("%d = fhandler_disk_file::open (%s, %p)", res, - get_win32_name (), flags); + syscall_printf ("%d = fhandler_disk_file::open (%S, %p)", res, + pc.get_nt_native_path (), flags); return res; } -- cgit v1.2.3