search for: waitforjob

Displaying 11 results from an estimated 11 matches for "waitforjob".

2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -848,6 +848,8 @@ bail: goto out; } + jp = NULL; + /* Execute the command. */ switch (cmdentry.cmdtype) { default: @@ -856,7 +858,6 @@ bail: INTOFF; jp = makejob(cmd, 1); if (forkshell(jp, cmd, FORK_FG) != 0) { - status = waitforjob(jp); INTON; break; } @@ -875,22 +876,22 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - goto readstatus; + break; } raise: longjmp(handler->loc, 1); } - goto readstatu...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...644 --- a/usr/dash/eval.c +++ b/usr/dash/eval.c @@ -848,6 +848,8 @@ bail: goto out; } + jp = NULL; + /* Execute the command. */ switch (cmdentry.cmdtype) { default: @@ -856,7 +858,6 @@ bail: INTOFF; jp = makejob(cmd, 1); if (forkshell(jp, cmd, FORK_FG) != 0) { - status = waitforjob(jp); INTON; break; } @@ -875,22 +876,22 @@ bail: if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { if (exception == EXERROR && spclbltin <= 0) { FORCEINTON; - goto readstatus; + break; } raise: longjmp(handler->loc, 1); } - goto readstatu...
2019 Jan 25
0
[klibc:update-dash] jobs - Do not block when waiting on SIGCHLD
...D, the process may have already been waited on and therefore we must be prepared for the case that wait may block. So ensure that it doesn't by using WNOHANG. Furthermore, multiple jobs may have exited when gotsigchld is set. Therefore we need to wait until there are no zombies left. Lastly, waitforjob needs to be called with interrupts off and the original patch broke that. Fixes: 03876c0743a5 ("eval: Reap zombies after built-in...") Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 12 +...
2020 Mar 28
0
[klibc:update-dash] dash: jobs - Do not block when waiting on SIGCHLD
...D, the process may have already been waited on and therefore we must be prepared for the case that wait may block. So ensure that it doesn't by using WNOHANG. Furthermore, multiple jobs may have exited when gotsigchld is set. Therefore we need to wait until there are no zombies left. Lastly, waitforjob needs to be called with interrupts off and the original patch broke that. Fixes: 03876c0743a5 ("eval: Reap zombies after built-in...") Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/eval.c | 12 +...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...s) } out: popstackmark(&smark); + + return status; } @@ -465,7 +469,7 @@ out: * Kick off a subshell to evaluate a tree. */ -STATIC void +STATIC int evalsubshell(union node *n, int flags) { struct job *jp; @@ -494,8 +498,8 @@ nofork: status = 0; if (! backgnd) status = waitforjob(jp); - exitstatus = status; INTON; + return status; } @@ -541,7 +545,7 @@ expredir(union node *n) * of all the rest.) */ -STATIC void +STATIC int evalpipe(union node *n, int flags) { struct job *jp; @@ -549,6 +553,7 @@ evalpipe(union node *n, int flags) int pipelen; int prevfd;...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...s) } out: popstackmark(&smark); + + return status; } @@ -465,7 +469,7 @@ out: * Kick off a subshell to evaluate a tree. */ -STATIC void +STATIC int evalsubshell(union node *n, int flags) { struct job *jp; @@ -494,8 +498,8 @@ nofork: status = 0; if (! backgnd) status = waitforjob(jp); - exitstatus = status; INTON; + return status; } @@ -541,7 +545,7 @@ expredir(union node *n) * of all the rest.) */ -STATIC void +STATIC int evalpipe(union node *n, int flags) { struct job *jp; @@ -549,6 +553,7 @@ evalpipe(union node *n, int flags) int pipelen; int prevfd;...
2010 Apr 02
2
(fwd) dash fix for job control off warning
...kaging. > Bonus is sparc32 socket test. > Pulled this; there seems to be a problem with the new version of dash with job control off. I can't tell if it is just a warning or is a manifest bug. The solution is simple: --- a/usr/dash/jobs.h +++ b/usr/dash/jobs.h @@ -105,5 +105,5 @@ int waitforjob(struct job *); int stoppedjobs(void); #if ! JOBS -#define setjobctl(on) /* do nothing */ +#define setjobctl(on) ((void)(on)) /* do nothing */ #endif ... to keep the code syntactically valid even when setjobctl() is used as the body of an if statement. -hpa ----- End forwarded message -...
2020 Mar 28
0
[klibc:update-dash] dash: jobs: Only clear gotsigchld when waiting for everything
..., int mode, pid_t pid) { TRACE(("In parent shell: child = %d\n", pid)); - if (!jp) { - while (jobless && dowait(DOWAIT_NORMAL, 0) > 0); - jobless++; + if (!jp) return; - } #if JOBS if (mode != FORK_NOJOB && jp->jobctl) { int pgrp; @@ -974,17 +966,10 @@ waitforjob(struct job *jp) int st; TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0)); - if (!jp) { - int pid = gotsigchld; - - while (pid > 0) - pid = dowait(DOWAIT_NORMAL, NULL); - + dowait(jp ? DOWAIT_BLOCK : DOWAIT_NORMAL, jp); + if (!jp) return exitstatus; - } - while (j...
2010 Apr 06
1
[patch v2] dash fix for job control off warning
...l off. I can't tell if it is just a warning or is a manifest bug. usr/dash/trap.c: In function `exitshell': usr/dash/trap.c:376: warning: suggest braces around empty body in an `if' statement The solution is simple: --- a/usr/dash/jobs.h +++ b/usr/dash/jobs.h @@ -105,5 +105,5 @@ int waitforjob(struct job *); int stoppedjobs(void); #if ! JOBS -#define setjobctl(on) /* do nothing */ +#define setjobctl(on) ((void)(on)) /* do nothing */ #endif ... to keep the code syntactically valid even when setjobctl() is used as the body of an if statement. -hpa ----- End forwarded message -...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add vfork support
...jobctl(int); int killcmd(int, char **); @@ -101,6 +104,7 @@ void showjobs(struct output *, int); int waitcmd(int, char **); struct job *makejob(union node *, int); int forkshell(struct job *, union node *, int); +struct job *vforkexec(union node *n, char **argv, const char *path, int idx); int waitforjob(struct job *); int stoppedjobs(void); diff --git a/usr/dash/trap.c b/usr/dash/trap.c index a3aeb33e..1ad27e99 100644 --- a/usr/dash/trap.c +++ b/usr/dash/trap.c @@ -181,16 +181,19 @@ void setsignal(int signo) { int action; + int lvforked; char *t, tsig; struct sigaction act; + lvforked...
2010 Mar 28
1
[git pull v3] dash, sh4, ipconfig, dprintf, fstype, README's
hello hpa! added on top of queue ext4 fix, that Ubuntu is carrying from cjwatson. Got missed out in previous pull requests. Btrfs recognition in fstype. the patch queue contains sync with latest dash, sh4 fix by Debian porters, dprintf usage in ipconfig, kinit and nfsmount instead of buggy DEBUG macro. ipconfig memcpy usage to avoid strict aliasing warnings. Some interesting README's got