summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2018-10-10 11:17:58 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-10-10 11:17:58 +0100
commit0d3a786b7cff90868a586e5e3a491b82589a236d (patch)
tree80a33e6551153c3ec43e15bdac7aca33c896d560 /Src/builtin.c
parent46c448cf9b31f1d6bc3fdd86953550417cc78c75 (diff)
downloadzsh-0d3a786b7cff90868a586e5e3a491b82589a236d.tar.gz
zsh-0d3a786b7cff90868a586e5e3a491b82589a236d.tar.xz
zsh-0d3a786b7cff90868a586e5e3a491b82589a236d.zip
43669: ensure explicit exit status is used over implicit
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index e01e035cc..8dcdcc024 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5723,7 +5723,7 @@ int exit_val;
 void
 realexit(void)
 {
-    exit(exit_val ? exit_val : lastval);
+    exit((shell_exiting || exit_pending) ? exit_val : lastval);
 }
 
 /* As realexit(), but call _exit instead */
@@ -5732,7 +5732,7 @@ realexit(void)
 void
 _realexit(void)
 {
-    _exit(exit_val ? exit_val : lastval);
+    _exit((shell_exiting || exit_pending) ? exit_val : lastval);
 }
 
 /* exit the shell.  val is the return value of the shell.  *