diff options
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; } |