[Devel] [PATCH 11/11] cr_tests: Exit with failure when appropriate.

Matt Helsley matthltc at us.ibm.com
Wed Aug 19 21:58:14 PDT 2009


Without this change it's virtually impossible indicate failure.

Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
Cc: containers at lists.linux-foundation.org
---
 futex/plain.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/futex/plain.c b/futex/plain.c
index daf1bef..3b51176 100644
--- a/futex/plain.c
+++ b/futex/plain.c
@@ -110,7 +110,7 @@ void sig_dump(int signum)
 int main(int argc, char **argv)
 {
 	pid_t kids[N];
-	int i, num_killed = 0;
+	int i, num_killed = 0, excode = EXIT_FAILURE;
 
 	/* FIXME eventually stdio streams should be harmless */
 	close(0);
@@ -180,11 +180,12 @@ int main(int argc, char **argv)
 		if (num_killed)
 			log("INFO", "killed %d remaining child tasks.\n",
 				num_killed);
-	}
+	} else
+		excode = EXIT_SUCCESS;
 	dump("After 2:");
 
 	do_wait(N);
 	dump("After 3:");
 	fclose(logfp);
-	exit(0);
+	exit(excode);
 }
-- 
1.5.6.3

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list