[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] pkd_hello.c: fix return code upon test failure
[Thread Prev] | [Thread Next]
- Subject: [PATCH 1/3] pkd_hello.c: fix return code upon test failure
- From: Jon Simons <jon@xxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Sat, 9 Sep 2017 20:12:33 -0700
- To: libssh@xxxxxxxxxx
- Cc: Jon Simons <jon@xxxxxxxxxxxxx>
Signed-off-by: Jon Simons <jon@xxxxxxxxxxxxx> --- tests/pkd/pkd_hello.c | 9 +++++---- 1 file 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; } -- 2.14.1
[PATCH 0/3] pkd: fix return code check and some races | Jon Simons <jon@xxxxxxxxxxxxx> |