From da30b4b787695fbf77e5d941ff350a66ca572bcb Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 6 Oct 2014 10:39:47 +0800 Subject: [BUILTIN] Exit without arguments in a trap should use status outside traps POSIX now requires that exit without arguments in a trap should return the last command status prior to executing traps. This patch implements this behaviour. Signed-off-by: Herbert Xu --- src/eval.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/eval.h') diff --git a/src/eval.h b/src/eval.h index dc8acd2..6e62137 100644 --- a/src/eval.h +++ b/src/eval.h @@ -37,6 +37,7 @@ extern char *commandname; /* currently executing command */ extern int exitstatus; /* exit status of last command */ extern int back_exitstatus; /* exit status of backquoted command */ +extern int savestatus; /* exit status of last command outside traps */ struct backcmd { /* result of evalbackcmd */ -- cgit 1.4.1