mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
waitpid: fix deadlock
This commit is contained in:
@@ -51,12 +51,12 @@ syscallret syscall_waitpid(pid_t pid, int *status, int options){
|
|||||||
sibling = NULL;
|
sibling = NULL;
|
||||||
|
|
||||||
while(child){
|
while(child){
|
||||||
if(pid > 0 && child->pid != pid)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(child->state == PROC_STATE_ZOMBIE){
|
if(child->state == PROC_STATE_ZOMBIE){
|
||||||
loop = false;
|
if((pid > 0 && child->pid == pid) || pid == 0){
|
||||||
break;
|
loop = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(child->sibling)
|
if(child->sibling)
|
||||||
|
|||||||
Reference in New Issue
Block a user