Module: xenomai-forge Branch: next Commit: 7b3ca1acdae56521c11f3bbcd8df7d57d781cb7c URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=7b3ca1acdae56521c11f3bbcd8df7d57d781cb7c
Author: Philippe Gerum <r...@xenomai.org> Date: Thu Sep 11 08:55:19 2014 +0200 testsuite/smokey: cope with missing fork() in fork-exec test We still use fork() when present, in order to check for the several pthread_atfork() handlers we have in libcobalt. --- testsuite/smokey/fork-exec/fork-exec.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/testsuite/smokey/fork-exec/fork-exec.c b/testsuite/smokey/fork-exec/fork-exec.c index 5e620da..79fe234 100644 --- a/testsuite/smokey/fork-exec/fork-exec.c +++ b/testsuite/smokey/fork-exec/fork-exec.c @@ -19,6 +19,12 @@ smokey_test_plugin(fork_exec, "Check fork->exec sequence." ); +#ifdef HAVE_FORK +#define do_fork fork +#else +#define do_fork vfork +#endif + /* * The purpose of this test is to check whether Cobalt detects and * handles a fork->exec sequence properly for Xenomai-enabled threads, @@ -33,13 +39,9 @@ static int run_fork_exec(struct smokey_test *t, int argc, char *const argv[]) { struct timespec req; - switch (fork()) { + switch (do_fork()) { case -1: - if (errno == ENOSYS) { - smokey_note("fork() not available -- discarding test"); - return 0; - } - error(1, errno, "fork"); + error(1, errno, "fork/vfork"); case 0: /* * Re-exec ourselves without running any test, this is _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git