From e7d14d7b534b56adaf851f549fa530547c3ebfc9 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Sun, 31 May 2020 23:57:03 -0700 Subject: [PATCH] x52test: Cleanup if successful or cancelled Commit be1f7e0 fixed the error handling, but missed this line. The original behavior was to restore the X52 LED and MFD state after completing all the tests, or if the user cancelled the tests using Ctrl-C. This commit fixes that regression, so that it will preserve the state only if it encountered an error during the test, not if it was cancelled. --- utils/test/x52_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/test/x52_test.c b/utils/test/x52_test.c index d732972..ba17de1 100644 --- a/utils/test/x52_test.c +++ b/utils/test/x52_test.c @@ -147,7 +147,7 @@ static int run_tests(int test_set) fprintf(stderr, _("Received %s signal, quitting...\n"), strsignal(-rc)); } - if (rc >= 0) test_cleanup(); + if (rc <= 0) test_cleanup(); libx52_exit(dev); return 0; }