summary refs log tree commit diff
path: root/src/error.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2010-11-28 20:22:00 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2010-11-28 20:22:00 +0800
commita42317f10233cf2fcff033cc705fd14315188374 (patch)
treecc08389d11e461fee8f30d931df34bc8ae434158 /src/error.c
parent[MAN] Document optional open parenthesis for case patterns (diff)
downloaddash-a42317f10233cf2fcff033cc705fd14315188374.tar.gz
dash-a42317f10233cf2fcff033cc705fd14315188374.zip
[ERROR] Allow the originator of EXERROR to set the exit status
Some errors have exit status values specified by POSIX and it is
therefore desirable to be able to set the exit status at the EXERROR
source rather than in main.c.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--src/error.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/error.c b/src/error.c
index e304d3d..f1a358d 100644
--- a/src/error.c
+++ b/src/error.c
@@ -163,6 +163,8 @@ sh_error(const char *msg, ...)
 {
 	va_list ap;
 
+	exitstatus = 2;
+
 	va_start(ap, msg);
 	exverror(EXERROR, msg, ap);
 	/* NOTREACHED */