+Thu Aug 3 15:04:34 1995 Sam Hartman <hartmans@tertius.mit.edu>
+
+ * configure.in: Check for vhangup and killpg.
+
+ * cleanup.c (pty_cleanup): Kill the process group associated with
+ the pty if using revoke. This won't always work, but will at
+ least attempt to remove processes associated with the pty.
+
Wed Aug 2 11:59:19 1995 Sam Hartman <hartmans@tertius.mit.edu>
* init.c (pty_init): New file to handle initialization--currently only error tables.
#endif
#ifdef HAVE_REVOKE
revoke(slave);
+ /*
+ * Revoke isn't guaranteed to send a SIGHUP to the processes it
+ * dissociates from the terminal. The best solution without a Posix
+ * mechanism for forcing a hangup is to killpg() the process
+ * group of the pty. This will at least kill the shell and
+ * hopefully, the child processes. This is not always the case, however.
+ * If the shell puts each job in a process group and doesn't pass
+ * along SIGHUP, all processes may not die.
+ */
+ if ( pid > 0 ) {
+ #ifdef HAVE_KILLPG
+ killpg(pid, SIGHUP);
+ #else
+ kill( -(pid), SIGHUP );
+#endif /*HAVE_KILLPG*/
+ }
#else /* HAVE_REVOKE*/
#ifdef VHANG_LAST
if ( retval = ( pty_open_ctty( slave, &fd )))