aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cpr.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/cpr.c')
-rw-r--r--g10/cpr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/g10/cpr.c b/g10/cpr.c
index 0fc45b179..3142ac439 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -303,6 +303,20 @@ write_status_begin_signing (gcry_md_hd_t md)
}
+/* Write a FAILURE status line. */
+void
+write_status_failure (const char *where, gpg_error_t err)
+{
+ if (!statusfp || !status_currently_allowed (STATUS_FAILURE))
+ return; /* Not enabled or allowed. */
+
+ fprintf (statusfp, "[GNUPG:] %s %s %u\n",
+ get_status_string (STATUS_FAILURE), where, err);
+ if (fflush (statusfp) && opt.exit_on_status_write_error)
+ g10_exit (0);
+}
+
+
static int
myread(int fd, void *buf, size_t count)
{