Support negative first argument in waitpid
Make waitpid wait any process with the pgid of -<1st-arg> when setting minus value to the first argument.
This commit is contained in:
@ -327,7 +327,10 @@ rescan:
|
||||
|
||||
ihk_mc_spinlock_lock_noirq(&child_iter->lock);
|
||||
|
||||
if (pid == -1 || (pid == 0 && pgid == child_iter->pgid) || pid == child_iter->pid) {
|
||||
if ((pid < 0 && -pid == child_iter->pgid) ||
|
||||
pid == -1 ||
|
||||
(pid == 0 && pgid == child_iter->pgid) ||
|
||||
(pid > 0 && pid == child_iter->pid)) {
|
||||
child = child_iter;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user