← Commit list

7f0d7ae4f

Denis Vlasenko
Denis Vlasenko
2007-01-18
FAILED Duration: 3s

Subject

fix subtle bug inherited from dash

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+8 -4
@@ -11938,7 +11938,11 @@ exitshell(void)
TRACE(("pid %d, exitshell(%d)\n", getpid(), status));
if (setjmp(loc.loc)) {
if (exception == EXEXIT)
- _exit(exitstatus);
+/* dash bug: it just does _exit(exitstatus) here
+ * but we have to do setjobctl(0) first!
+ * (bug is still not fixed in dash-0.5.3 - if you run dash
+ * under Midnight Commander, on exit MC is backgrounded) */
+ status = exitstatus;
goto out;
}
handler = &loc;
@@ -11947,16 +11951,16 @@ exitshell(void)
evalstring(p, 0);
}
flushall();
- setjobctl(0);
#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
if (iflag && rootshell) {
const char *hp = lookupvar("HISTFILE");
- if(hp != NULL )
- save_history ( hp );
+ if (hp != NULL)
+ save_history(hp);
}
#endif
out:
+ setjobctl(0);
_exit(status);
/* NOTREACHED */
}