summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2017-12-26 16:23:18 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2017-12-26 16:23:18 +0000
commitc8a5f6652730ae91db4064bc66415f237a3baab9 (patch)
treeed83adb91eaf92faaeb7875f352d06917959414c
parent2fe0ea732498348055db2ae0bca3e1b2d3eeeb47 (diff)
Notes
-rw-r--r--bin/sh/eval.c7
-rw-r--r--bin/sh/jobs.c6
2 files changed, 6 insertions, 7 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index 7898693c968c..6adc3ac6426d 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
#include <sys/resource.h>
-#include <sys/wait.h> /* For WIFSIGNALED(status) */
#include <errno.h>
/*
@@ -840,7 +839,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
struct parsefile *savetopfile;
volatile int e;
char *lastarg;
- int realstatus;
+ int signaled;
int do_clearcmdentry;
const char *path = pathval();
int i;
@@ -1163,9 +1162,9 @@ cmddone:
parent: /* parent process gets here (if we forked) */
if (mode == FORK_FG) { /* argument to fork */
INTOFF;
- exitstatus = waitforjob(jp, &realstatus);
+ exitstatus = waitforjob(jp, &signaled);
INTON;
- if (iflag && loopnest > 0 && WIFSIGNALED(realstatus)) {
+ if (iflag && loopnest > 0 && signaled) {
evalskip = SKIPBREAK;
skipcount = loopnest;
}
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index e2434493417d..d5293a08158e 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -1016,7 +1016,7 @@ vforkexecshell(struct job *jp, char **argv, char **envp, const char *path, int i
*/
int
-waitforjob(struct job *jp, int *origstatus)
+waitforjob(struct job *jp, int *signaled)
{
#if JOBS
int propagate_int = jp->jobctl && jp->foreground;
@@ -1039,8 +1039,8 @@ waitforjob(struct job *jp, int *origstatus)
setcurjob(jp);
#endif
status = jp->ps[jp->nprocs - 1].status;
- if (origstatus != NULL)
- *origstatus = status;
+ if (signaled != NULL)
+ *signaled = WIFSIGNALED(status);
/* convert to 8 bits */
if (WIFEXITED(status))
st = WEXITSTATUS(status);