summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */