diff options
author | Christopher Faylor <me@cgf.cx> | 2011-12-17 07:01:21 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-12-17 07:01:21 +0000 |
commit | ce3318344c573af96b932b618766aadfffb65cf2 (patch) | |
tree | 0e26016d6c52692d2b0eb3f559c857575678d630 | |
parent | 60cd6a7798d2d8de8d49fd10d7a6ec43183a7c58 (diff) | |
download | newlib-ce3318344c573af96b932b618766aadfffb65cf2.zip newlib-ce3318344c573af96b932b618766aadfffb65cf2.tar.gz newlib-ce3318344c573af96b932b618766aadfffb65cf2.tar.bz2 |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 12 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 13 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/wait.cc | 7 |
5 files changed, 22 insertions, 17 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fed985c..aa9d379 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +2011-12-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * 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. + 2011-12-16 Christopher Faylor <me.cygwin2011@cgf.cx> Implement fhandler reference counting. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 3fcd91c..a15c9c3 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1144,8 +1144,6 @@ set_signal_mask (sigset_t newmask, sigset_t& oldmask) oldmask = newmask; if (mask_bits) sig_dispatch_pending (true); - else - sigproc_printf ("not calling sig_dispatch_pending"); mask_sync.release (); } diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 04499e6..6624bc7 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 (); } diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index f77c451..cdf3c85 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1170,10 +1170,7 @@ write (int fd, const void *ptr, size_t len) res = cfd->write (ptr, len); done: - if (fd == 1 || fd == 2) - paranoid_printf ("%R = write(%d, %p, %d)", res, fd, ptr, len); - else - syscall_printf ("%R = write(%d, %p, %d)", res, fd, ptr, len); + syscall_printf ("%R = write(%d, %p, %d)", res, fd, ptr, len); MALLOC_CHECK; return res; diff --git a/winsup/cygwin/wait.cc b/winsup/cygwin/wait.cc index 0d965e1..91a7623 100644 --- a/winsup/cygwin/wait.cc +++ b/winsup/cygwin/wait.cc @@ -81,7 +81,7 @@ wait4 (int intpid, int *status, int options, struct rusage *r) res = cancelable_wait (waitfor); - sigproc_printf ("%d = WaitForSingleObject (...)", res); + sigproc_printf ("%d = cancelable_wait (...)", res); if (w->ev == NULL) { @@ -109,10 +109,7 @@ wait4 (int intpid, int *status, int options, struct rusage *r) break; } - sigproc_printf ("intpid %d, status %p, w->status %d, options %d, res %d", - intpid, status, w->status, options, res); + syscall_printf ("%R = wait4(%d, %p, %d, %p)", res, intpid, w->status, options, r); w->status = -1; - if (res < 0) - sigproc_printf ("*** errno %d", get_errno ()); return res; } |