diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-10-29 20:26:57 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-10-29 20:26:57 +0200 |
commit | f6fe2dd0e6c9f50f4ee98025b1342e31be67dcdd (patch) | |
tree | f28ff7595a7c363d398114dae4d717067c28b906 /src/ck.c | |
parent | 5683c51d17b5eed7d2f070aa4e49cc21b65d82e5 (diff) | |
download | ck-f6fe2dd0e6c9f50f4ee98025b1342e31be67dcdd.tar.gz ck-f6fe2dd0e6c9f50f4ee98025b1342e31be67dcdd.tar.bz2 ck-f6fe2dd0e6c9f50f4ee98025b1342e31be67dcdd.zip |
Make exit value -1 if error, 0 else.
Diffstat (limited to 'src/ck.c')
-rw-r--r-- | src/ck.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -39,6 +39,7 @@ ERRLOG(main); int main(int argc, const char **argv) { UserOpt opt; Conf conf; + int rc = -1; initialize_errlog(argc, argv); initialize_conf(&conf); @@ -64,9 +65,10 @@ int main(int argc, const char **argv) { /* Run action and print results */ switch(opt.action) { -#define X(ACTION) \ - case CKA_##ACTION: \ - print_##ACTION##_result(run_##ACTION(&opt, &conf)); \ +#define X(ACTION) \ + case CKA_##ACTION: \ + rc = run_##ACTION(&opt, &conf); \ + print_##ACTION##_result(rc); \ break; CK_ACTIONS #undef X @@ -77,5 +79,5 @@ int main(int argc, const char **argv) { free_user_opt(&opt); free_conf(&conf); report_errlog(); - return 0; + return rc; } |