From 1520663dd52c25496f285eb2e08077318c600759 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 25 Jan 2013 00:01:08 +0000 Subject: Fix some compilation errors when child status disabled; new waitpid logic not encoding/decoding status properly git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5561 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/sched/sched_waitpid.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nuttx/sched/sched_waitpid.c') diff --git a/nuttx/sched/sched_waitpid.c b/nuttx/sched/sched_waitpid.c index ecdc60a2c..d7484fca9 100644 --- a/nuttx/sched/sched_waitpid.c +++ b/nuttx/sched/sched_waitpid.c @@ -384,13 +384,13 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) DEBUGASSERT(!retains || rtcb->children); if (retains && (child = task_exitchild(rtcb)) != NULL) { - /* A child has exitted. Apparently we missed the signal. + /* A child has exited. Apparently we missed the signal. * Return the saved exit status. */ /* The child has exited. Return the saved exit status */ - *stat_loc = child->ch_status; + *stat_loc = child->ch_status << 8; /* Discard the child entry and break out of the loop */ @@ -415,7 +415,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) { /* The child has exited. Return the saved exit status */ - *stat_loc = child->ch_status; + *stat_loc = child->ch_status << 8; /* Discard the child entry and break out of the loop */ @@ -452,7 +452,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) */ if (rtcb->nchildren == 0 || - (pid != (pid_t)-1 && (ret = kill((pid_t)id, 0)) < 0)) + (pid != (pid_t)-1 && (ret = kill(pid, 0)) < 0)) { /* We know that the child task was running okay we stared, * so we must have lost the signal. What can we do? @@ -481,7 +481,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) { /* Yes... return the status and PID (in the event it was -1) */ - *stat_loc = info.si_status; + *stat_loc = info.si_status << 8; pid = info.si_pid; break; } -- cgit v1.2.3