summaryrefslogtreecommitdiff
path: root/nuttx/sched/sched_waitpid.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-25 00:01:08 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-25 00:01:08 +0000
commit1520663dd52c25496f285eb2e08077318c600759 (patch)
treed518e0fc4392bc0990718a7692e3b09a0934b79a /nuttx/sched/sched_waitpid.c
parent2a8490551299ccfdfa300c1b859719c08581e553 (diff)
downloadpx4-nuttx-1520663dd52c25496f285eb2e08077318c600759.tar.gz
px4-nuttx-1520663dd52c25496f285eb2e08077318c600759.tar.bz2
px4-nuttx-1520663dd52c25496f285eb2e08077318c600759.zip
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
Diffstat (limited to 'nuttx/sched/sched_waitpid.c')
-rw-r--r--nuttx/sched/sched_waitpid.c10
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;
}