mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix waitpid(2) when the status pointer is NULL.
This commit is contained in:
parent
f744e80b88
commit
c14e6c05b9
1 changed files with 3 additions and 1 deletions
|
@ -518,7 +518,9 @@ pid_t sys_waitpid(pid_t pid, int* user_status, int options)
|
|||
{
|
||||
int status = 0;
|
||||
pid_t ret = CurrentProcess()->Wait(pid, &status, options);
|
||||
if ( 0 < ret && !CopyToUser(user_status, &status, sizeof(status)) )
|
||||
if ( 0 < ret &&
|
||||
user_status &&
|
||||
!CopyToUser(user_status, &status, sizeof(status)) )
|
||||
return -1;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue