Commit 1a2132bf authored by Lucas Russo's avatar Lucas Russo

libs/libhutils/*: fix confusing wait_chdl_[timed] () return value

Now, hutils_wait_chld () returns, on successfully
waiting a child, its PID number, instead of 0.
This gives the ability to other functions to
distinguish between "nothing to wait for" from
"successfully waited child".
parent 5de2632a
...@@ -245,7 +245,7 @@ int hutils_wait_chld (void) ...@@ -245,7 +245,7 @@ int hutils_wait_chld (void)
WTERMSIG(chld_status)); WTERMSIG(chld_status));
} }
return 0; return chld_pid;
} }
int hutils_wait_chld_timed (int timeout) int hutils_wait_chld_timed (int timeout)
...@@ -260,7 +260,7 @@ int hutils_wait_chld_timed (int timeout) ...@@ -260,7 +260,7 @@ int hutils_wait_chld_timed (int timeout)
} }
err = hutils_wait_chld (); err = hutils_wait_chld ();
if (err == 0) { if (err > 0) {
DBE_DEBUG (DBG_HAL_UTILS | DBG_LVL_WARN, "[hutils:utils] " DBE_DEBUG (DBG_HAL_UTILS | DBG_LVL_WARN, "[hutils:utils] "
"hutils_wait_chld_timed: finished waiting\n"); "hutils_wait_chld_timed: finished waiting\n");
goto exit; goto exit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment