diff options
author | Werner Koch <wk@gnupg.org> | 2010-01-08 20:18:49 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-01-08 20:18:49 +0100 |
commit | be45bf3d544873ff4bc86496c6ab6c5f16c6a26e (patch) | |
tree | 31c443f6d989917ea476143abc4fd5d2ae749faa /g10/cpr.c | |
parent | Fix bug 1146 (diff) | |
download | gnupg2-be45bf3d544873ff4bc86496c6ab6c5f16c6a26e.tar.xz gnupg2-be45bf3d544873ff4bc86496c6ab6c5f16c6a26e.zip |
Add dummu option --passwd for gpg.
Collected changes.
Diffstat (limited to 'g10/cpr.c')
-rw-r--r-- | g10/cpr.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,6 +1,6 @@ /* status.c - Status message and command-fd interface * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, - * 2004, 2005, 2006 Free Software Foundation, Inc. + * 2004, 2005, 2006, 2010 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -157,8 +157,23 @@ write_status_text ( int no, const char *text) } +/* Wrte an ERROR status line using a full gpg-error error value. */ void -write_status_error (const char *where, int errcode) +write_status_error (const char *where, gpg_error_t err) +{ + 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, err); + if (fflush (statusfp) && opt.exit_on_status_write_error) + g10_exit (0); +} + + +/* Same as above but only putputs the error code. */ +void +write_status_errcode (const char *where, int errcode) { if (!statusfp || !status_currently_allowed (STATUS_ERROR)) return; /* Not enabled or allowed. */ |