From 8dad6c1d1ccd042c5700e7fa07025ce00da590fc Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 22 Jun 2026 16:18:19 +0200 Subject: Let gpgme_op_export also return operational errors. * src/export.c (gpgme_op_export): On success check and return operational errors. -- This has been part of gpgme_op_export_ext but was obviously forgotten to add also to the old function. GnuPG-bug-id: 8287 --- src/export.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/export.c b/src/export.c index 59bdfbc9..810ea450 100644 --- a/src/export.c +++ b/src/export.c @@ -256,7 +256,22 @@ gpgme_op_export (gpgme_ctx_t ctx, const char *pattern, err = export_start (ctx, 1, pattern, mode, keydata); if (!err) - err = _gpgme_wait_one (ctx); + { + err = _gpgme_wait_one (ctx); + if (!err) + { + /* For this synchronous operation we check for operational + * errors and return them. */ + void *hook; + op_data_t opd; + + err = _gpgme_op_data_lookup (ctx, OPDATA_EXPORT, &hook, -1, NULL); + opd = hook; + if (!err) + err = opd->err ? opd->err : opd->failure_code; + } + } + return err; } -- cgit