summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r--Userland/Libraries/LibC/sys/wait.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Userland/Libraries/LibC/sys/wait.cpp b/Userland/Libraries/LibC/sys/wait.cpp
index 3affc55be8..41c896a24d 100644
--- a/Userland/Libraries/LibC/sys/wait.cpp
+++ b/Userland/Libraries/LibC/sys/wait.cpp
@@ -45,14 +45,13 @@ pid_t waitpid(pid_t waitee, int* wstatus, int options)
if (rc < 0)
return rc;
- if (wstatus) {
- if ((options & WNOHANG) && siginfo.si_pid == 0) {
- // No child in a waitable state was found. All other fields
- // in siginfo are undefined
- *wstatus = 0;
- return 0;
- }
+ if ((options & WNOHANG) && siginfo.si_pid == 0) {
+ // No child in a waitable state was found. All other fields
+ // in siginfo are undefined
+ return 0;
+ }
+ if (wstatus) {
switch (siginfo.si_code) {
case CLD_EXITED:
*wstatus = siginfo.si_status << 8;
@@ -65,7 +64,7 @@ pid_t waitpid(pid_t waitee, int* wstatus, int options)
break;
case CLD_CONTINUED:
*wstatus = 0xffff;
- return 0; // return 0 if running
+ break;
default:
VERIFY_NOT_REACHED();
}