aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cpr.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/cpr.c')
-rw-r--r--g10/cpr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/cpr.c b/g10/cpr.c
index 79eff3143..28cba698f 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -280,6 +280,19 @@ write_status_printf (int no, const char *format, ...)
g10_exit (0);
}
+/* Write a WARNING status line using a full gpg-error error value. */
+void
+write_status_warning (const char *where, gpg_error_t err)
+{
+ if (!statusfp || !status_currently_allowed (STATUS_WARNING))
+ return; /* Not enabled or allowed. */
+
+ es_fprintf (statusfp, "[GNUPG:] %s %s %u\n",
+ get_status_string (STATUS_WARNING), where, err);
+ if (es_fflush (statusfp) && opt.exit_on_status_write_error)
+ g10_exit (0);
+}
+
/* Write an ERROR status line using a full gpg-error error value. */
void