1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-04 20:40:57 +02:00

The `wait' builtin accepts only PIDs it can find in the job table.

This commit is contained in:
Bart Schaefer 2000-07-28 16:35:47 +00:00
parent 7697f6134f
commit b7c6421796
2 changed files with 13 additions and 1 deletions

View file

@ -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>
* 12421: Src/Makemod.in.in: extra tab

View file

@ -1289,7 +1289,13 @@ bin_fg(char *name, char **argv, char *ops, int func)
if (func == BIN_WAIT && isanum(*argv)) {
/* 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;
thisjob = ocj;
continue;