aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cpr.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/cpr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/cpr.c b/g10/cpr.c
index 6e89d393d..60cc97bf6 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -157,6 +157,19 @@ write_status_text ( int no, const char *text)
}
+void
+write_status_error (const char *where, int errcode)
+{
+ if (!statusfp || !status_currently_allowed (STATUS_ERROR))
+ return; /* Not enabled or allowed. */
+
+ fprintf (statusfp, "[GNUPG:] %s %s %u\n",
+ get_status_string (STATUS_ERROR), where, gpg_err_code (errcode));
+ if (fflush (statusfp) && opt.exit_on_status_write_error)
+ g10_exit (0);
+}
+
+
/*
* Write a status line with a buffer using %XX escapes. If WRAP is >
* 0 wrap the line after this length. If STRING is not NULL it will