mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-06-06 15:26:04 +02:00
more (|un)queue_signals(), this time for the job control builtins (13509)
This commit is contained in:
parent
cd02c345af
commit
fbe44ac838
|
@ -1,3 +1,8 @@
|
|||
2001-02-20 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 13509: Src/jobs.c: more (|un)queue_signals(), this time for the
|
||||
job control builtins
|
||||
|
||||
2001-02-19 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* Alexandre: 13280: Doc/Zsh/expn.yo, Src/hist.c, Src/string.c,
|
||||
|
|
10
Src/jobs.c
10
Src/jobs.c
|
@ -1248,6 +1248,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
|||
return 1;
|
||||
}
|
||||
|
||||
queue_signals();
|
||||
/* If necessary, update job table. */
|
||||
if (unset(NOTIFY))
|
||||
scanjobs();
|
||||
|
@ -1267,6 +1268,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
|||
point or else. */
|
||||
if (curjob == -1 || (jobtab[curjob].stat & STAT_NOPRINT)) {
|
||||
zwarnnam(name, "no current job", NULL, 0);
|
||||
unqueue_signals();
|
||||
return 1;
|
||||
}
|
||||
firstjob = curjob;
|
||||
|
@ -1280,11 +1282,13 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
|||
(ops['s'] && jobtab[job].stat & STAT_STOPPED))
|
||||
printjob(job + jobtab, lng, 2);
|
||||
}
|
||||
unqueue_signals();
|
||||
return 0;
|
||||
} else { /* Must be BIN_WAIT, so wait for all jobs */
|
||||
for (job = 0; job != MAXJOB; job++)
|
||||
if (job != thisjob && jobtab[job].stat)
|
||||
zwaitjob(job, SIGINT);
|
||||
unqueue_signals();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1319,6 +1323,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
|||
if (!(jobtab[job].stat & STAT_INUSE) ||
|
||||
(jobtab[job].stat & STAT_NOPRINT)) {
|
||||
zwarnnam(name, "no such job: %d", 0, job);
|
||||
unqueue_signals();
|
||||
return 1;
|
||||
}
|
||||
/* We have a job number. Now decide what to do with it. */
|
||||
|
@ -1334,6 +1339,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
|||
/* Silly to bg a job already running. */
|
||||
zwarnnam(name, "job already in background", NULL, 0);
|
||||
thisjob = ocj;
|
||||
unqueue_signals();
|
||||
return 1;
|
||||
}
|
||||
/* It's time to shuffle the jobs around! Reset the current job,
|
||||
|
@ -1391,6 +1397,7 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
|||
}
|
||||
thisjob = ocj;
|
||||
}
|
||||
unqueue_signals();
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -1473,6 +1480,7 @@ bin_kill(char *nam, char **argv, char *ops, int func)
|
|||
argv++;
|
||||
}
|
||||
|
||||
queue_signals();
|
||||
setcurjob();
|
||||
|
||||
/* Remaining arguments specify processes. Loop over them, and send the
|
||||
|
@ -1509,6 +1517,8 @@ bin_kill(char *nam, char **argv, char *ops, int func)
|
|||
returnval++;
|
||||
}
|
||||
}
|
||||
unqueue_signals();
|
||||
|
||||
return returnval < 126 ? returnval : 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue