diff options
Diffstat (limited to 'sm/gpgsm.c')
-rw-r--r-- | sm/gpgsm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 26b05773c..bea0184e3 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -1803,6 +1803,10 @@ main ( int argc, char **argv) gnupg_inhibit_set_foregound_window (1); } + /* Better make sure that we have a statusfp so that a failure status + * in gpgsm_exit can work even w/o any preeding status messages. */ + gpgsm_init_statusfp (&ctrl); + /* Add default keybox. */ if (!nrings && default_keyring && !opt.use_keyboxd) { @@ -2356,6 +2360,12 @@ gpgsm_exit (int rc) else if (opt.assert_signer_list && !assert_signer_true) rc = 1; + /* If we had an error but not printed an error message, do it now. + * Note that the function will never print a second failure status + * line. */ + if (rc) + gpgsm_exit_failure_status (); + gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE); if (opt.debug & DBG_MEMSTAT_VALUE) { |