From ce3318344c573af96b932b618766aadfffb65cf2 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 17 Dec 2011 07:01:21 +0000 Subject: * exceptions.cc (set_signal_mask): Remove useless debugging output. * fhandler.cc (fhandler_base::write): Ditto. (fhandler_base_overlapped::close): Cancel any ongoing I/O before closing. * syscalls.cc (write): Default to always reporting all writes in strace output via syscall_printf. * wait.cc (wait4): Fix debugging output. Use standard syscall leaver output. --- winsup/cygwin/fhandler.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 04499e6e7..6624bc7da 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -839,16 +839,13 @@ fhandler_base::write (const void *ptr, size_t len) NTSTATUS status; status = NtFsControlFile (get_output_handle (), NULL, NULL, NULL, &io, FSCTL_SET_SPARSE, NULL, 0, NULL, 0); - syscall_printf ("%p = NtFsControlFile(%S, FSCTL_SET_SPARSE)", - status, pc.get_nt_native_path ()); + debug_printf ("%p = NtFsControlFile(%S, FSCTL_SET_SPARSE)", + status, pc.get_nt_native_path ()); } } if (wbinary ()) - { - debug_printf ("binary write"); - res = raw_write (ptr, len); - } + res = raw_write (ptr, len); else { debug_printf ("text write"); @@ -1222,6 +1219,10 @@ fhandler_base_overlapped::close () } else { + /* Cancelling seems to be necessary for cases where a reader is + still executing either in another thread or when a signal handler + performs a close. */ + CancelIo (get_io_handle ()); destroy_overlapped (); res = fhandler_base::close (); } -- cgit v1.2.3