From eb4ea3062edbb98bcfef6559a90d302a1717ff9c Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 6 Sep 2007 02:20:13 +0000 Subject: [PATCH] Bash applies the same logic on SIGHUP as on normal exit now. Jobs are sent a SIGHUP only when that was explicitely requested via shopt huponexit. Thus it behaves like other shells (ksh, tcsh, ash,...). Background processes are no longer terminated when closing the terminal. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22188 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/bash/sig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/bash/sig.c b/src/bin/bash/sig.c index 80dc1eccc8..714c138f4d 100644 --- a/src/bin/bash/sig.c +++ b/src/bin/bash/sig.c @@ -54,6 +54,7 @@ extern int last_command_exit_value; extern int return_catch_flag; extern int loop_level, continuing, breaking; extern int parse_and_execute_level, shell_initialized; +extern int hup_on_exit; /* Non-zero after SIGINT. */ int interrupt_state; @@ -412,7 +413,7 @@ termination_unwind_protect (sig) #endif /* HISTORY */ #if defined (JOB_CONTROL) - if (interactive && sig == SIGHUP) + if (interactive && sig == SIGHUP && hup_on_exit) hangup_all_jobs (); end_job_control (); #endif /* JOB_CONTROL */