+2015-06-08 Takashi Yano <takashi.yano@nifty.ne.jp>
+
+ * fhandler_tty.cc (fhandler_pty_slave::write): Move causing of SIGHUP
+ into fhandler_pty_master::close().
+ (fhandler_pty_slave::read): Ditto.
+ (fhandler_pty_master::close): Ditto.
+
2015-06-08 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 4.
default:
__seterrno_from_win_error (err);
}
- raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */
towrite = -1;
}
return towrite;
goto out;
}
if (!bytes_available (bytes_in_pipe))
- raise (SIGHUP);
+ {
+ ReleaseMutex (input_mutex);
+ set_errno (EIO);
+ totalread = -1;
+ goto out;
+ }
/* On first peek determine no. of bytes to flush. */
if (!ptr && len == UINT_MAX)
if (!ReadFile (get_handle (), buf, readlen, &n, NULL))
{
termios_printf ("read failed, %E");
- raise (SIGHUP);
- bytes_in_pipe = 0;
- ptr = NULL;
+ ReleaseMutex (input_mutex);
+ set_errno (EIO);
+ totalread = -1;
+ goto out;
}
else
{
change after successful read. So we have to peek into the pipe
again to see if input is still available */
if (!bytes_available (bytes_in_pipe))
- raise (SIGHUP);
+ {
+ ReleaseMutex (input_mutex);
+ set_errno (EIO);
+ totalread = -1;
+ goto out;
+ }
if (n)
{
len -= n;
else if (obi.HandleCount == 1)
{
termios_printf("Closing last master of pty%d", get_minor ());
+ if (get_ttyp ()->getsid () > 0)
+ kill (get_ttyp ()->getsid (), SIGHUP);
SetEvent (input_available_event);
}