mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
waitpid: fix pid > 0
This commit is contained in:
@@ -59,9 +59,8 @@ syscallret_t syscall_waitpid(context_t *context, pid_t pid, int *status, int opt
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pid > 0 && iterator->pid == pid)
|
||||
if ((pid > 0 && iterator->pid == pid) || pid == -1) {
|
||||
desired = iterator;
|
||||
|
||||
bool intstatus = interrupt_set(false);
|
||||
spinlock_acquire(&iterator->signals.lock);
|
||||
if (iterator->signals.continueunwaited && (options & WCONTINUED)) {
|
||||
@@ -76,6 +75,7 @@ syscallret_t syscall_waitpid(context_t *context, pid_t pid, int *status, int opt
|
||||
interrupt_set(intstatus);
|
||||
|
||||
zombie = iterator->state == SCHED_PROC_STATE_ZOMBIE;
|
||||
}
|
||||
|
||||
if (zombie || continued || stopped)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user