From d824bcf985a8a5fd96169135fd13a37729af4b16 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 29 Aug 2000 02:06:49 +0000 Subject: * signal.cc (_raise): New function. * exceptions.cc (unused_sig_wrapper): Remove _raise. * sigproc.h (class sigframe): Default frames to skip to zero or suffer from exuberant optimization. * fhandler_tty.cc (fhandler_tty::write): Set appropriate errno when WriteFile to pipe fails. --- winsup/cygwin/ChangeLog | 9 +++++++++ winsup/cygwin/exceptions.cc | 12 ------------ winsup/cygwin/fhandler_tty.cc | 10 +++++++++- winsup/cygwin/signal.cc | 6 ++++++ winsup/cygwin/sigproc.h | 2 +- 5 files changed, 25 insertions(+), 14 deletions(-) (limited to 'winsup/cygwin') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 81455c155..31ff41853 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +Mon Aug 28 22:03:21 2000 Christopher Faylor + + * signal.cc (_raise): New function. + * exceptions.cc (unused_sig_wrapper): Remove _raise. + * sigproc.h (class sigframe): Default frames to skip to zero or suffer + from exuberant optimization. + * fhandler_tty.cc (fhandler_tty::write): Set appropriate errno when + WriteFile to pipe fails. + Fri Aug 25 23:44:48 2000 Christopher Faylor * pinfo.h (pinfo): Un-inline release. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 18af64d67..8b208b973 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1074,18 +1074,6 @@ void unused_sig_wrapper () and returns to orignal caller. */ __asm__ volatile (" .text - .globl __raise -__raise: - pushl %%ebp - movl %%esp,%%ebp - movl 8(%%ebp),%%eax - pushl %%eax - movl $_myself,%%eax - pushl %6(%%eax) - call __kill - mov %%ebp,%%esp - popl %%ebp - ret _sigreturn: addl $4,%%esp diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 2e291ba32..bdbe641aa 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -568,9 +568,17 @@ fhandler_tty_slave::write (const void *ptr, size_t len) if (WriteFile (get_output_handle (), buf, n, &n, NULL) == FALSE) { + DWORD err = GetLastError (); termios_printf ("WriteFile failed, %E"); - towrite = (DWORD) -1; + switch (err) + { + case ERROR_NO_DATA: + err = ERROR_IO_DEVICE; + default: + __seterrno (); + } _raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */ + towrite = (DWORD) -1; break; } diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 2927712dd..38a1aba52 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -144,6 +144,12 @@ kill_worker (pid_t pid, int sig) return res; } +int +_raise (int sig) +{ + return _kill (myself->pid, sig); +} + /* This is called _kill because the real kill is in newlib. */ int _kill (pid_t pid, int sig) diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index 9e1c3fb4d..9d3b68922 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -60,7 +60,7 @@ public: } sigframe () {st = NULL;} - sigframe (sigthread &t, int up = 1) + sigframe (sigthread &t, int up = 0) { if (!t.frame && t.id == GetCurrentThreadId ()) set (t, up); -- cgit v1.2.3