diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-25 00:01:08 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-25 00:01:08 +0000 |
commit | b6472b58dcce32d4ab2051f13cef89a6f0296c28 (patch) | |
tree | d518e0fc4392bc0990718a7692e3b09a0934b79a /nuttx/sched/sched_waitpid.c | |
parent | a2ec48846f786e72a976038c9467b25a61ad5a9f (diff) | |
download | px4-firmware-b6472b58dcce32d4ab2051f13cef89a6f0296c28.tar.gz px4-firmware-b6472b58dcce32d4ab2051f13cef89a6f0296c28.tar.bz2 px4-firmware-b6472b58dcce32d4ab2051f13cef89a6f0296c28.zip |
Fix some compilation errors when child status disabled; new waitpid logic not encoding/decoding status properly
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5561 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sched_waitpid.c')
-rw-r--r-- | nuttx/sched/sched_waitpid.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |