summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_disk_file.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-08-14 14:48:52 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-08-14 14:48:52 +0000
commit4a971ce403ee1dba9d779219310043816a4c4768 (patch)
treee74d19e86394d08b204a6f7bb10df91fe169a85f /winsup/cygwin/fhandler_disk_file.cc
parent7d2ade334193638dbd55b85e1909408606bcde97 (diff)
downloadcygnal-4a971ce403ee1dba9d779219310043816a4c4768.tar.gz
cygnal-4a971ce403ee1dba9d779219310043816a4c4768.tar.bz2
cygnal-4a971ce403ee1dba9d779219310043816a4c4768.zip
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc13
1 files changed, 5 insertions, 8 deletions
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;
}