Browse Source

failtest: call failtest_exit_check even in non-failing parent.

Rusty Russell 15 years ago
parent
commit
32aaf75342
1 changed files with 5 additions and 5 deletions
  1. 5 5
      ccan/failtest/failtest.c

+ 5 - 5
ccan/failtest/failtest.c

@@ -980,16 +980,16 @@ void failtest_exit(int status)
 {
 {
 	int i;
 	int i;
 
 
-	if (control_fd == -1) {
-		free_everything();
-		exit(status);
-	}
-
 	if (failtest_exit_check) {
 	if (failtest_exit_check) {
 		if (!failtest_exit_check(history, history_num))
 		if (!failtest_exit_check(history, history_num))
 			child_fail(NULL, 0, "failtest_exit_check failed\n");
 			child_fail(NULL, 0, "failtest_exit_check failed\n");
 	}
 	}
 
 
+	if (control_fd == -1) {
+		free_everything();
+		exit(status);
+	}
+
 	/* Cleanup everything, in reverse order. */
 	/* Cleanup everything, in reverse order. */
 	for (i = history_num - 1; i >= 0; i--)
 	for (i = history_num - 1; i >= 0; i--)
 		if (history[i].cleanup)
 		if (history[i].cleanup)