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.
pull/22/head
nirenjan 2020-05-31 23:57:03 -07:00
parent a16b1822aa
commit e7d14d7b53
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}