aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-05-19 11:06:18 +0000
committerWerner Koch <[email protected]>2023-05-24 10:13:48 +0000
commit097701e69835774883d9c055462e22e3111737a0 (patch)
tree145ede0551cb869572c1420e586ba27d0a033574
parentgpg: Improve error code for file already exists. (diff)
downloadgnupg-097701e69835774883d9c055462e22e3111737a0.tar.gz
gnupg-097701e69835774883d9c055462e22e3111737a0.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
-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;
}