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:
Masamichi Takagi
2014-09-11 15:14:48 +09:00
parent 35dc8a3368
commit 7e6fbc4854

View File

@ -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;
}