summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
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;