summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjg <tjg>1999-10-12 14:10:22 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:16 +0100
commit84872e38eee4c7f5fec2a12563f9607e62c94219 (patch)
tree72b29e19c760bdd81d2642a464bbc41937bbb5de
parent43ce7b24fad3fc46860648d00544176526dcafcc (diff)
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.
-rw-r--r--AUTHORS8
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.am5
-rw-r--r--status.c3
4 files changed, 15 insertions, 6 deletions
diff --git a/AUTHORS b/AUTHORS
index 3395148..94fc823 100644
--- 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
index 360c14e..e12fb41 100644
--- 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
index ccd990b..d6d23f6 100644
--- 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
index b594e4b..5b37aa5 100644
--- 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 */