* 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-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.
2011-12-16 Christopher Faylor <me.cygwin2011@cgf.cx>
Implement fhandler reference counting.
oldmask = newmask;
if (mask_bits)
sig_dispatch_pending (true);
oldmask = newmask;
if (mask_bits)
sig_dispatch_pending (true);
- else
- sigproc_printf ("not calling sig_dispatch_pending");
NTSTATUS status;
status = NtFsControlFile (get_output_handle (), NULL, NULL, NULL,
&io, FSCTL_SET_SPARSE, NULL, 0, NULL, 0);
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 ());
- {
- debug_printf ("binary write");
- res = raw_write (ptr, len);
- }
+ res = raw_write (ptr, len);
else
{
debug_printf ("text write");
else
{
debug_printf ("text write");
+ /* 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 ();
}
destroy_overlapped ();
res = fhandler_base::close ();
}
res = cfd->write (ptr, len);
done:
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;
MALLOC_CHECK;
return res;
res = cancelable_wait (waitfor);
res = cancelable_wait (waitfor);
- sigproc_printf ("%d = WaitForSingleObject (...)", res);
+ sigproc_printf ("%d = cancelable_wait (...)", res);
- 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);
- if (res < 0)
- sigproc_printf ("*** errno %d", get_errno ());