aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgtar.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-05-19 11:06:18 +0000
committerWerner Koch <[email protected]>2023-05-19 11:06:18 +0000
commitcd7f286486f23f89367048730e651ac17b7f8b3f (patch)
tree116eb8ae44be8afd51a6daf8dc54dae2fdbf6f30 /tools/gpgtar.c
parentkbx,w32: Disable the fd-passing. (diff)
downloadgnupg-cd7f286486f23f89367048730e651ac17b7f8b3f.tar.gz
gnupg-cd7f286486f23f89367048730e651ac17b7f8b3f.zip
gpgtar: Emit FAILURE status line.
* tools/gpgtar.c (main): Write status line before exit. -- Due to the new way we support gpgtar in GPGME we need status lines to detect a final error. GnuPG-bug-id: 6497
Diffstat (limited to 'tools/gpgtar.c')
-rw-r--r--tools/gpgtar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index b2ccc9f8a..492b3d5e5 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -588,9 +588,19 @@ main (int argc, char **argv)
default:
log_error (_("invalid command (there is no implicit command)\n"));
+ err = 0;
break;
}
+ if (opt.status_stream)
+ {
+ if (err || log_get_errorcount (0))
+ es_fprintf (opt.status_stream, "[GNUPG:] FAILURE - %u\n",
+ err? err : gpg_error (GPG_ERR_GENERAL));
+ else
+ es_fprintf (opt.status_stream, "[GNUPG:] SUCCESS\n");
+ }
+
return log_get_errorcount (0)? 1:0;
}