diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-02-18 16:46:05 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-02-18 16:46:05 +0100 |
commit | 663ca58063a281d23dbc92a6fbd19011c3fbde41 (patch) | |
tree | 5a2e9f58a8f41db94ef221e12acead09c9828233 /apps/examples/ostest/ostest_main.c | |
parent | 104d5aa3654545b354f25750d3980181da8f6a0b (diff) | |
parent | 520a2b417410bed7db6f08a3a69f3bcccc55910b (diff) | |
download | px4-firmware-663ca58063a281d23dbc92a6fbd19011c3fbde41.tar.gz px4-firmware-663ca58063a281d23dbc92a6fbd19011c3fbde41.tar.bz2 px4-firmware-663ca58063a281d23dbc92a6fbd19011c3fbde41.zip |
Merge branch 'master' of github.com:PX4/Firmware
Diffstat (limited to 'apps/examples/ostest/ostest_main.c')
-rw-r--r-- | apps/examples/ostest/ostest_main.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/examples/ostest/ostest_main.c b/apps/examples/ostest/ostest_main.c index aab1ff045..3e4197fdc 100644 --- a/apps/examples/ostest/ostest_main.c +++ b/apps/examples/ostest/ostest_main.c @@ -43,8 +43,11 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <signal.h> #include <string.h> #include <sched.h> +#include <errno.h> + #include <nuttx/init.h> #include "ostest.h" @@ -264,6 +267,31 @@ static int user_main(int argc, char *argv[]) } check_test_memory_usage(); + /* If retention of child status is enable, then suppress it for this task. + * This task may produce many, many children (especially if + * CONFIG_EXAMPLES_OSTEST_LOOPS) and it does not harvest their exit status. + * As a result, the test may fail inappropriately unless retention of + * child exit status is disabled. + * + * So basically, this tests that child status can be disabled, but cannot + * verify that status is retained correctly. + */ + +#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) + { + struct sigaction sa; + int ret; + + sa.sa_handler = SIG_IGN; + sa.sa_flags = SA_NOCLDWAIT; + ret = sigaction(SIGCHLD, &sa, NULL); + if (ret < 0) + { + printf("user_main: ERROR: sigaction failed: %d\n", errno); + } + } +#endif + /* Check environment variables */ #ifndef CONFIG_DISABLE_ENVIRON show_environment(true, true, true); |