failtest: stop when leak detected.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 29 Nov 2011 22:44:11 +0000 (09:14 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 29 Nov 2011 22:44:11 +0000 (09:14 +1030)
Don't continue when we report a leak: tell the parent it's a failure.

ccan/failtest/failtest.c

index 1dad0864aa372fa3b7ead07a081f9e125f192bbc..56ace7431847c5ac9fd059b77d4b9271958a3fb7 100644 (file)
@@ -488,7 +488,10 @@ static NORETURN void failtest_cleanup(bool forced_cleanup, int status)
        }
 
        free_everything();
        }
 
        free_everything();
-       tell_parent(SUCCESS);
+       if (status == 0)
+               tell_parent(SUCCESS);
+       else
+               tell_parent(FAILURE);
        exit(status);
 }
 
        exit(status);
 }