This patch fixes a bug in bash. This patch is against bash 2.05 The issue (bug) is that when running 'suspend' command, to suspend shell it should call 'SIGTSTP' instead of 'SIGSTOP', as it seem to do the right thing when it is the last shell. The problem is that if it is login shell, then the shell would just "hang", replacing SIGSTOP, with SIGTSTP fixes the problem. Adding appropriate handlers further allows the shell itself to suspend itself. The patch is based on solutions found in tcsh (sh.func.c:dosuspend()) , as well as upon 10.20 "Job Control Signals" chapter of "Advanced Programming in the UNIX environment" by Richard Stevens. Adam Sulmcki Sun May 20 22:34:43 EDT 2001 http://www.eax.com/patches/ ------------------------------------------------------------------------------- --- bash-2.05/builtins/suspend.def-old Sun May 20 20:56:08 2001 +++ bash-2.05/builtins/suspend.def Sun May 20 22:33:50 2001 @@ -50,9 +50,7 @@ extern int job_control; static SigHandler *old_cont; -#if 0 -static SigHandler *old_stop; -#endif +static SigHandler *old_tstp; /* Continue handler. */ sighandler @@ -60,9 +58,6 @@ int sig; { set_signal_handler (SIGCONT, old_cont); -#if 0 - set_signal_handler (SIGSTOP, old_stop); -#endif SIGRETURN (0); } @@ -107,10 +102,9 @@ } old_cont = (SigHandler *)set_signal_handler (SIGCONT, suspend_continue); -#if 0 - old_stop = (SigHandler *)set_signal_handler (SIGSTOP, SIG_DFL); -#endif - killpg (shell_pgrp, SIGSTOP); + old_tstp = (SigHandler *)set_signal_handler (SIGTSTP, SIG_DFL); + killpg (shell_pgrp, SIGTSTP); + (SigHandler *)set_signal_handler (SIGTSTP, old_tstp); return (EXECUTION_SUCCESS); }