Displaying 4 results from an estimated 4 matches for "fork_nojob".
2012 Jul 02
0
[klibc:master] [EVAL] Remove unused EV_BACKCMD flag
...itstatus;
- evalcommand(n, EV_BACKCMD, result);
-
- ifsfirst = saveifs;
- ifslastp = savelastp;
- argbackq = saveargbackq;
- } else
-#endif
- {
- int pip[2];
- struct job *jp;
-
- if (pipe(pip) < 0)
- sh_error("Pipe call failed");
- jp = makejob(n, 1);
- if (forkshell(jp, n, FORK_NOJOB) == 0) {
- FORCEINTON;
- close(pip[0]);
- if (pip[1] != 1) {
- dup2(pip[1], 1);
- close(pip[1]);
- }
- ifsfree();
- evaltreenr(n, EV_EXIT);
- /* NOTREACHED */
+ if (pipe(pip) < 0)
+ sh_error("Pipe call failed");
+ jp = makejob(n, 1);
+ if (forkshell(jp, n, FORK_NOJ...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reset handler when entering a subshell
...}
if (forkshell(jp, lp->n, n->npipe.backgnd) == 0) {
+ reset_handler();
INTON;
if (pip[1] >= 0) {
close(pip[0]);
@@ -630,6 +633,7 @@ evalbackcmd(union node *n, struct backcmd *result)
sh_error("Pipe call failed");
jp = makejob(n, 1);
if (forkshell(jp, n, FORK_NOJOB) == 0) {
+ reset_handler();
FORCEINTON;
close(pip[0]);
if (pip[1] != 1) {
diff --git a/usr/dash/main.c b/usr/dash/main.c
index 6b3a0909..b2712cbd 100644
--- a/usr/dash/main.c
+++ b/usr/dash/main.c
@@ -71,6 +71,7 @@ int *dash_errno;
short profile_buf[16384];
extern int etext();
#endif
+...
2020 Mar 28
0
[klibc:update-dash] dash: jobs: Only clear gotsigchld when waiting for everything
...ss = 0;
}
STATIC inline void
forkparent(struct job *jp, union node *n, 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_BLO...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add vfork support
...shlvl++;
+ lvforked = vforked;
+
+ if (!lvforked) {
+ shlvl++;
+
+ closescript();
+ clear_traps();
+
+#if JOBS
+ /* do job control only in root shell */
+ jobctl = 0;
+#endif
+ }
- closescript();
- clear_traps();
#if JOBS
- /* do job control only in root shell */
- jobctl = 0;
if (mode != FORK_NOJOB && jp->jobctl && !oldlvl) {
pid_t pgrp;
@@ -878,17 +891,30 @@ forkchild(struct job *jp, union node *n, int mode)
}
}
if (!oldlvl && iflag) {
- setsignal(SIGINT);
- setsignal(SIGQUIT);
+ if (mode != FORK_BG) {
+ setsignal(SIGINT);
+ setsignal(SIGQUIT);
+...