Displaying 5 results from an estimated 5 matches for "jobrunning".
2019 Jan 25
0
[klibc:update-dash] jobs - Do not block when waiting on SIGCHLD
...rect)
diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
index 4548ae69..2b8e1afe 100644
--- a/usr/dash/jobs.c
+++ b/usr/dash/jobs.c
@@ -974,10 +974,17 @@ waitforjob(struct job *jp)
int st;
TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0));
- while ((jp && jp->state == JOBRUNNING) || gotsigchld)
- dowait(DOWAIT_BLOCK, jp);
- if (!jp)
+ if (!jp) {
+ int pid = gotsigchld;
+
+ while (pid > 0)
+ pid = dowait(DOWAIT_NORMAL, NULL);
+
return exitstatus;
+ }
+
+ while (jp->state == JOBRUNNING)
+ dowait(DOWAIT_BLOCK, jp);
st = getstatus(jp);
#if JOBS
if (jp->j...
2020 Mar 28
0
[klibc:update-dash] dash: jobs: Only clear gotsigchld when waiting for everything
...jp->waited = 1;
jp = jp->prev_job;
}
- if (dowait(DOWAIT_WAITCMD, 0) <= 0)
+ if (!dowait(DOWAIT_WAITCMD, 0))
goto sigout;
}
}
@@ -635,9 +632,8 @@ start:
} else
job = getjob(*argv, 0);
/* loop until process terminated or stopped */
- while (job->state == JOBRUNNING)
- if (dowait(DOWAIT_WAITCMD, 0) <= 0)
- goto sigout;
+ if (!dowait(DOWAIT_WAITCMD, job))
+ goto sigout;
job->waited = 1;
retval = getstatus(job);
repeat:
@@ -889,18 +885,14 @@ forkchild(struct job *jp, union node *n, int mode)
}
for (jp = curjob; jp; jp = jp->prev_job)...
2020 Mar 28
0
[klibc:update-dash] dash: jobs - Do not block when waiting on SIGCHLD
...rect)
diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
index 3ea7e122..400628ff 100644
--- a/usr/dash/jobs.c
+++ b/usr/dash/jobs.c
@@ -974,10 +974,17 @@ waitforjob(struct job *jp)
int st;
TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0));
- while ((jp && jp->state == JOBRUNNING) || gotsigchld)
- dowait(DOWAIT_BLOCK, jp);
- if (!jp)
+ if (!jp) {
+ int pid = gotsigchld;
+
+ while (pid > 0)
+ pid = dowait(DOWAIT_NORMAL, NULL);
+
return exitstatus;
+ }
+
+ while (jp->state == JOBRUNNING)
+ dowait(DOWAIT_BLOCK, jp);
st = getstatus(jp);
#if JOBS
if (jp->j...
2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...ntax.h redefines this */
#endif
+#include "eval.h"
#include "redir.h"
#include "show.h"
#include "main.h"
@@ -972,10 +973,11 @@ waitforjob(struct job *jp)
{
int st;
- TRACE(("waitforjob(%%%d) called\n", jobno(jp)));
- while (jp->state == JOBRUNNING) {
+ TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0));
+ while ((jp && jp->state == JOBRUNNING) || gotsigchld)
dowait(DOWAIT_BLOCK, jp);
- }
+ if (!jp)
+ return exitstatus;
st = getstatus(jp);
#if JOBS
if (jp->jobctl) {
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...ntax.h redefines this */
#endif
+#include "eval.h"
#include "redir.h"
#include "show.h"
#include "main.h"
@@ -972,10 +973,11 @@ waitforjob(struct job *jp)
{
int st;
- TRACE(("waitforjob(%%%d) called\n", jobno(jp)));
- while (jp->state == JOBRUNNING) {
+ TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0));
+ while ((jp && jp->state == JOBRUNNING) || gotsigchld)
dowait(DOWAIT_BLOCK, jp);
- }
+ if (!jp)
+ return exitstatus;
st = getstatus(jp);
#if JOBS
if (jp->jobctl) {