aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-18 01:12:57 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-18 01:12:57 +0000
commit7f0d7ae4f55a810d57ef07d5cd964435dd87e6dc (patch)
treebb671c9ac416e241e2aff7fabeaa2960f73406dc
parent41aaefce71bfdfb7d788c29e9df90971eecc8193 (diff)
downloadbusybox-w32-7f0d7ae4f55a810d57ef07d5cd964435dd87e6dc.tar.gz
busybox-w32-7f0d7ae4f55a810d57ef07d5cd964435dd87e6dc.tar.bz2
busybox-w32-7f0d7ae4f55a810d57ef07d5cd964435dd87e6dc.zip
fix subtle bug inherited from dash
-rw-r--r--shell/ash.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 95928e992..8ef8c465c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11938,7 +11938,11 @@ exitshell(void)
11938 TRACE(("pid %d, exitshell(%d)\n", getpid(), status)); 11938 TRACE(("pid %d, exitshell(%d)\n", getpid(), status));
11939 if (setjmp(loc.loc)) { 11939 if (setjmp(loc.loc)) {
11940 if (exception == EXEXIT) 11940 if (exception == EXEXIT)
11941 _exit(exitstatus); 11941/* dash bug: it just does _exit(exitstatus) here
11942 * but we have to do setjobctl(0) first!
11943 * (bug is still not fixed in dash-0.5.3 - if you run dash
11944 * under Midnight Commander, on exit MC is backgrounded) */
11945 status = exitstatus;
11942 goto out; 11946 goto out;
11943 } 11947 }
11944 handler = &loc; 11948 handler = &loc;
@@ -11947,16 +11951,16 @@ exitshell(void)
11947 evalstring(p, 0); 11951 evalstring(p, 0);
11948 } 11952 }
11949 flushall(); 11953 flushall();
11950 setjobctl(0);
11951#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY 11954#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
11952 if (iflag && rootshell) { 11955 if (iflag && rootshell) {
11953 const char *hp = lookupvar("HISTFILE"); 11956 const char *hp = lookupvar("HISTFILE");
11954 11957
11955 if(hp != NULL ) 11958 if (hp != NULL)
11956 save_history ( hp ); 11959 save_history(hp);
11957 } 11960 }
11958#endif 11961#endif
11959out: 11962out:
11963 setjobctl(0);
11960 _exit(status); 11964 _exit(status);
11961 /* NOTREACHED */ 11965 /* NOTREACHED */
11962} 11966}