[igt-dev] [PATCH 1/1] runner: Exit with a nonzero status if aborting

Petri Latvala petri.latvala at intel.com
Fri Nov 16 14:32:52 UTC 2018


Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
 runner/executor.c | 3 +++
 runner/runner.c   | 7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 089e6312..2038c3fd 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1240,6 +1240,8 @@ bool execute(struct execute_state *state,
 			free(reason);
 			free(nexttest);
 
+			status = false;
+
 			goto end;
 		}
 	}
@@ -1280,6 +1282,7 @@ bool execute(struct execute_state *state,
 			free(prev);
 			free(next);
 			free(reason);
+			status = false;
 			break;
 		}
 
diff --git a/runner/runner.c b/runner/runner.c
index b685786a..013af551 100644
--- a/runner/runner.c
+++ b/runner/runner.c
@@ -11,6 +11,7 @@ int main(int argc, char **argv)
 	struct settings settings;
 	struct job_list job_list;
 	struct execute_state state;
+	int exitcode = 0;
 
 	init_settings(&settings);
 	init_job_list(&job_list);
@@ -28,13 +29,13 @@ int main(int argc, char **argv)
 	}
 
 	if (!execute(&state, &settings, &job_list)) {
-		return 1;
+		exitcode = 1;
 	}
 
 	if (!generate_results_path(settings.results_path)) {
-		return 1;
+		exitcode = 1;
 	}
 
 	printf("Done.\n");
-	return 0;
+	return exitcode;
 }
-- 
2.11.0



More information about the igt-dev mailing list