From: Jérémie Galarneau Date: Wed, 26 Feb 2014 15:56:57 +0000 (-0500) Subject: Tests fix: Missing waitpid in fork test X-Git-Tag: v2.5.0-rc1~146 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=b871e4b3a823857987e1ea909edcb39cbec6febe;p=lttng-tools.git Tests fix: Missing waitpid in fork test Signed-off-by: Jérémie Galarneau Signed-off-by: David Goulet --- diff --git a/tests/regression/ust/fork/fork.c b/tests/regression/ust/fork/fork.c index 744e9203e..7df982b4d 100644 --- a/tests/regression/ust/fork/fork.c +++ b/tests/regression/ust/fork/fork.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #define TRACEPOINT_DEFINE @@ -51,12 +52,19 @@ int main(int argc, char **argv, char *env[]) result = execve(argv[1], args, env); if (result == -1) { perror("execve"); - return 1; + result = 1; + goto end; } } else { printf("child_pid %d\n", result); tracepoint(ust_tests_fork, after_fork_parent, getpid()); + if (waitpid(result, NULL, 0) < 0) { + perror("waitpid"); + result = 1; + goto end; + } } - - return 0; + result = 0; +end: + return result; }