Skip to content
Snippets Groups Projects
Commit 00cde572 authored by patacongo's avatar patacongo
Browse files

Fix some missing logic and inconsistencies in child status logic; Fix a bug...

Fix some missing logic and inconsistencies in child status logic; Fix a bug introduced into sigaction()

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5560 42af7a65-404d-4744-a932-0658087f49c3
parent 0cefd784
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment