From: jeremie.galarneau@efficios.com (Jérémie Galarneau)
Subject: [lttng-dev] [PATCH lttng-tools] Tests fix: Missing waitpid in fork test
Date: Wed, 26 Feb 2014 10:56:57 -0500 [thread overview]
Message-ID: <1393430217-12953-1-git-send-email-jeremie.galarneau@efficios.com> (raw)
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
tests/regression/ust/fork/fork.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tests/regression/ust/fork/fork.c b/tests/regression/ust/fork/fork.c
index 744e920..7df982b 100644
--- a/tests/regression/ust/fork/fork.c
+++ b/tests/regression/ust/fork/fork.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <stdlib.h>
#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;
}
--
1.9.0
next reply other threads:[~2014-02-26 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-26 15:56 Jérémie Galarneau [this message]
2014-02-26 18:38 ` David Goulet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393430217-12953-1-git-send-email-jeremie.galarneau@efficios.com \
--to=jeremie.galarneau@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox