From 00d2afc400ae8184d88e5cb19f534e166d91ef6b Mon Sep 17 00:00:00 2001 From: Djalal Harouni Date: Wed, 23 Jul 2014 17:34:32 +0100 Subject: [PATCH] test: correctly set the 'ret' variable Signed-off-by: Djalal Harouni --- test/test-kdbus-policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c index e3e3e7e..6a39040 100644 --- a/test/test-kdbus-policy.c +++ b/test/test-kdbus-policy.c @@ -200,7 +200,7 @@ static int kdbus_normal_test(const char *bus, const char *name, static int kdbus_fork_test(const char *bus, const char *name, struct conn **conn_db) { - int ret; + int ret = 0; int status; pid_t pid; int test_done = 0; @@ -241,6 +241,7 @@ child_fail: ret = waitpid(pid, &status, 0); if (ret < 0) { + ret = -errno; fprintf(stderr, "error waitpid: %d (%m)\n", ret); goto out; } -- 2.34.1