diff options
author | Christopher Faylor <me@cgf.cx> | 2000-08-29 02:06:49 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-08-29 02:06:49 +0000 |
commit | d824bcf985a8a5fd96169135fd13a37729af4b16 (patch) | |
tree | 9e9cb02a7c42cf39bcd4daef1c418fb5da82bbc6 /winsup/cygwin/fhandler_tty.cc | |
parent | 1b38471e5ed5a618f316be3ada5c30ccc17f1e51 (diff) | |
download | cygnal-d824bcf985a8a5fd96169135fd13a37729af4b16.tar.gz cygnal-d824bcf985a8a5fd96169135fd13a37729af4b16.tar.bz2 cygnal-d824bcf985a8a5fd96169135fd13a37729af4b16.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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; } |