commit 84872e38eee4c7f5fec2a12563f9607e62c94219
parent 43ce7b24fad3fc46860648d00544176526dcafcc
Author: tjg <tjg>
Date: Tue, 12 Oct 1999 14:10:22 +0000
1999-10-12
Portability: status.c assumes traditional Unix layout of 0 and 1 exit
statuses in the parent, which is not shared by BeOS. Add mkstatval.c.
Diffstat:
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/AUTHORS b/AUTHORS
@@ -29,7 +29,7 @@ version of rc presented here differs in some respects.
Tim would like to thank these people for their contributions since he
took over maintenance of rc. Aharon Robbins, Arvid Requate, Bengt
Kleberg, Brynjulv Hauksson, Byron Rakitzis, Chris Siebenmann, Dale
-Scheetz, David Swasey, Gerry Tomlinson, Gert-Jan Vons, Ian Lance Taylor,
-Jeremy Fitzhardinge, Marc Moorcroft, Mark K Gardner, Raymond Venneker,
-Rich $alz, Rob Savoye, Scott Schwartz, Stefan Dalibor, Tom Culliton, Tom
-Tromey, Vincent Broman, Wolfgang Zekoll.
+Scheetz, David Swasey, Donn Cave, Gerry Tomlinson, Gert-Jan Vons, Ian
+Lance Taylor, Jeremy Fitzhardinge, Marc Moorcroft, Mark K Gardner,
+Raymond Venneker, Rich $alz, Rob Savoye, Scott Schwartz, Stefan Dalibor,
+Steve Simon, Tom Culliton, Tom Tromey, Vincent Broman, Wolfgang Zekoll.
diff --git a/ChangeLog b/ChangeLog
@@ -612,3 +612,8 @@ Changes since rc-1.5b2
Bug: absolute globs don't need special case in doglob(). Avoids
creating path names like `//tmp', which is a UNC path under CygWin.
+
+1999-10-12
+
+ Portability: status.c assumes traditional Unix layout of 0 and 1 exit
+ statuses in the parent, which is not shared by BeOS. Add mkstatval.c.
diff --git a/Makefile.am b/Makefile.am
@@ -26,7 +26,7 @@ SYSTEM = system.o
endif
bin_PROGRAMS = rc
-noinst_PROGRAMS = mksignal tripping $(HISTORY)
+noinst_PROGRAMS = mksignal mkstatval tripping $(HISTORY)
rc_SOURCES = builtins.c except.c exec.c fn.c footobar.c getopt.c glob.c glom.c hash.c heredoc.c input.c lex.c list.c main.c match.c nalloc.c open.c parse.c print.c redir.c signal.c status.c tree.c utils.c var.c wait.c walk.c which.c
@@ -44,6 +44,9 @@ EXTRA_DIST = EXAMPLES RELDATE addon.c addon.h history.1 parse.y rc.1 trip.rc
sigmsgs.c sigmsgs.h: mksignal
./mksignal
+statval.h: mkstatval
+ ./mkstatval > statval.h
+
CONFIGURE_DEPENDENCIES = RELDATE
DISTCLEANFILES = sigmsgs.c sigmsgs.h
diff --git a/status.c b/status.c
@@ -2,6 +2,7 @@
#include "rc.h"
#include "sigmsgs.h"
+#include "statval.h"
#include "wait.h"
/* status == the wait() value of the last command in the pipeline, or the last command */
@@ -40,7 +41,7 @@ extern int getstatus() {
}
extern void set(bool code) {
- setstatus(-1, (!code) << 8); /* exit status 1 == 0x100 */
+ setstatus(-1, code ? STATUS0 : STATUS1);
}
/* take a pipeline and store the exit statuses. Check to see whether any of the children dumped core */