summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorToby Goodwin <tjg@star.le.ac.uk>1999-01-11 10:55:18 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:22:09 +0100
commite11c7df86144bed383ac6bbeaecc3017d18b37db (patch)
tree6fad44921723eab2f2eb1c76b7214b4e79b818f3 /exec.c
parent671e1e2d1599aa8c5f1010b3fe75c151c56a7403 (diff)
beta: rc-1.5b4
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/exec.c b/exec.c
index 6a0082e..a0ba8d4 100644
--- a/exec.c
+++ b/exec.c
@@ -1,10 +1,9 @@
/* exec.c */
-#include <signal.h>
#include <errno.h>
-#include <setjmp.h>
-#include "rc.h"
-#include "jbwrap.h"
+#include <signal.h>
+#include "rc.h"
+#include "wait.h"
/*
Takes an argument list and does the appropriate thing (calls a
builtin, calls a function, etc.)
@@ -92,11 +91,7 @@ extern void exec(List *s, bool parent) {
return;
rc_exit(getstatus());
}
-#if HASH_BANG
- execve(path, (char * const *) av, (char * const *) ev);
-#else
- my_execve(path, (char * const *) av, (char * const *) ev); /* bogus, huh? */
-#endif
+ rc_execve(path, (char * const *) av, (char * const *) ev);
#ifdef DEFAULTINTERP
if (errno == ENOEXEC) {
@@ -105,6 +100,7 @@ extern void exec(List *s, bool parent) {
execve(*av, (char * const *) av, (char * const *) ev);
}
#endif
+
uerror(*av);
rc_exit(1);
/* NOTREACHED */
@@ -123,7 +119,7 @@ extern void exec(List *s, bool parent) {
prompt, even though there's a SIGINT in its signal
vector.
*/
- if ((stat & 0xff) == 0)
+ if (WIFEXITED(stat))
nl_on_intr = FALSE;
sigchk();
nl_on_intr = TRUE;