diff options
author | Jon Simons <jon@jonsimons.org> | 2017-09-09 20:12:33 -0700 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2017-09-11 16:30:45 +0200 |
commit | 4c4a03f056724c59def75b4d3332014b5ef0e9f2 (patch) | |
tree | 6596f7ea77f1fe23dca40fd6c912345307be3498 /tests/pkd | |
parent | 73d76a263876e18c33ad2db91039ca389b2a9cd1 (diff) | |
download | libssh-4c4a03f056724c59def75b4d3332014b5ef0e9f2.tar.gz libssh-4c4a03f056724c59def75b4d3332014b5ef0e9f2.tar.xz libssh-4c4a03f056724c59def75b4d3332014b5ef0e9f2.zip |
pkd_hello.c: fix return code upon test failure
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/pkd')
-rw-r--r-- | tests/pkd/pkd_hello.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/pkd/pkd_hello.c b/tests/pkd/pkd_hello.c index 4b0ae0ac..09c76975 100644 --- a/tests/pkd/pkd_hello.c +++ b/tests/pkd/pkd_hello.c @@ -555,6 +555,7 @@ static int pkd_run_tests(void) { int main(int argc, char **argv) { int i = 0; int rc = 0; + int exit_code = -1; unsetenv("SSH_AUTH_SOCK"); @@ -575,9 +576,9 @@ int main(int argc, char **argv) { printf("%s\n", testmap[i++].testname); } } else { - rc = pkd_run_tests(); - if (rc != 0) { - fprintf(stderr, "pkd_run_tests failed: %d\n", rc); + exit_code = pkd_run_tests(); + if (exit_code != 0) { + fprintf(stderr, "pkd_run_tests failed: %d\n", exit_code); } } @@ -586,5 +587,5 @@ int main(int argc, char **argv) { fprintf(stderr, "ssh_finalize: %d\n", rc); } out: - return rc; + return exit_code; } |