mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 11:21:13 +02:00
The `wait' builtin accepts only PIDs it can find in the job table.
This commit is contained in:
parent
7697f6134f
commit
b7c6421796
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2000-07-28 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 12393: Src/jobs.c: The `wait' builtin searches the job table for
|
||||||
|
any process ID it's asked to wait for, and rejects those it
|
||||||
|
doesn't find.
|
||||||
|
|
||||||
2000-07-28 Peter Stephenson <pws@csr.com>
|
2000-07-28 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
* 12421: Src/Makemod.in.in: extra tab
|
* 12421: Src/Makemod.in.in: extra tab
|
||||||
|
|
|
@ -1289,7 +1289,13 @@ bin_fg(char *name, char **argv, char *ops, int func)
|
||||||
|
|
||||||
if (func == BIN_WAIT && isanum(*argv)) {
|
if (func == BIN_WAIT && isanum(*argv)) {
|
||||||
/* wait can take a pid; the others can't. */
|
/* wait can take a pid; the others can't. */
|
||||||
waitforpid((long)atoi(*argv));
|
pid_t pid = (long)atoi(*argv);
|
||||||
|
Job j;
|
||||||
|
Process p;
|
||||||
|
if (findproc(pid, &j, &p))
|
||||||
|
waitforpid(pid);
|
||||||
|
else
|
||||||
|
zwarnnam(name, "pid %d is not a child of this shell", 0, pid);
|
||||||
retval = lastval2;
|
retval = lastval2;
|
||||||
thisjob = ocj;
|
thisjob = ocj;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue