From 65ecec1abe9ce864060f61f03d025fe98e7cbf55 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 5 Nov 2009 02:17:07 +0000 Subject: [PATCH] 2009-11-05 Marcus Brinkmann * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro. * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise. * delete.c (gpgme_op_delete_start): Likewise. * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start): Likewise. * encrypt.c (gpgme_op_encrypt_start): Likewise. * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise. * export.c (gpgme_op_export_start, gpgme_op_export_ext_start) (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise. * genkey.c (gpgme_op_genkey_start): Likewise. * getauditlog.c (gpgme_op_getauditlog_start): Likewise. * import.c (gpgme_op_import_start, gpgme_op_import_keys_start): Likewise. * opassuan.c (gpgme_op_assuan_transact_start): Likewise. * sign.c (gpgme_op_sign_start): Likewise. * verify.c (gpgme_op_verify_start): Likewise. * vfs-create.c (gpgme_op_vfs_create): Likewise. * vfs-mount.c (gpgme_op_vfs_mount): Likewise. --- src/ChangeLog | 21 +++++++++++++++++++++ src/decrypt-verify.c | 5 ++++- src/decrypt.c | 5 ++++- src/delete.c | 5 ++++- src/edit.c | 10 ++++++++-- src/encrypt-sign.c | 5 ++++- src/encrypt.c | 5 ++++- src/export.c | 17 +++++++++++++---- src/genkey.c | 5 ++++- src/getauditlog.c | 5 ++++- src/gpgme-tool.c | 4 ++-- src/import.c | 10 ++++++++-- src/opassuan.c | 9 +++++---- src/sign.c | 4 +++- src/verify.c | 4 +++- src/vfs-create.c | 8 +++++--- src/vfs-mount.c | 6 ++++-- 17 files changed, 100 insertions(+), 28 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 15234b9..d5aebe3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,24 @@ +2009-11-05 Marcus Brinkmann + + * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro. + * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise. + * delete.c (gpgme_op_delete_start): Likewise. + * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start): + Likewise. + * encrypt.c (gpgme_op_encrypt_start): Likewise. + * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise. + * export.c (gpgme_op_export_start, gpgme_op_export_ext_start) + (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise. + * genkey.c (gpgme_op_genkey_start): Likewise. + * getauditlog.c (gpgme_op_getauditlog_start): Likewise. + * import.c (gpgme_op_import_start, gpgme_op_import_keys_start): + Likewise. + * opassuan.c (gpgme_op_assuan_transact_start): Likewise. + * sign.c (gpgme_op_sign_start): Likewise. + * verify.c (gpgme_op_verify_start): Likewise. + * vfs-create.c (gpgme_op_vfs_create): Likewise. + * vfs-mount.c (gpgme_op_vfs_mount): Likewise. + 2009-11-04 Marcus Brinkmann * ath.h (ath_self): New prototype. Include diff --git a/src/decrypt-verify.c b/src/decrypt-verify.c index 77b725f..f28dda0 100644 --- a/src/decrypt-verify.c +++ b/src/decrypt-verify.c @@ -87,9 +87,12 @@ gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) { + gpgme_error_t err; + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt_verify_start", ctx, "cipher=%p, plain=%p", cipher, plain); - return TRACE_ERR (decrypt_verify_start (ctx, 0, cipher, plain)); + err = decrypt_verify_start (ctx, 0, cipher, plain); + return TRACE_ERR (err); } diff --git a/src/decrypt.c b/src/decrypt.c index da08e74..132a04b 100644 --- a/src/decrypt.c +++ b/src/decrypt.c @@ -365,9 +365,12 @@ gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) { + gpgme_error_t err; + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt_start", ctx, "cipher=%p, plain=%p", cipher, plain); - return TRACE_ERR (decrypt_start (ctx, 0, cipher, plain)); + err = decrypt_start (ctx, 0, cipher, plain); + return TRACE_ERR (err); } diff --git a/src/delete.c b/src/delete.c index bfb980a..0cd3e94 100644 --- a/src/delete.c +++ b/src/delete.c @@ -94,11 +94,14 @@ gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, int allow_secret) { + gpgme_error_t err; + TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx, "key=%p (%s), allow_secret=%i", key, (key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", allow_secret); - return TRACE_ERR (delete_start (ctx, 0, key, allow_secret)); + err = delete_start (ctx, 0, key, allow_secret); + return TRACE_ERR (err); } diff --git a/src/edit.c b/src/edit.c index 14f6f60..fbdcfdf 100644 --- a/src/edit.c +++ b/src/edit.c @@ -139,11 +139,14 @@ gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out) { + gpgme_error_t err; + TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit_start", ctx, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, (key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", fnc, fnc_value, out); - return TRACE_ERR (edit_start (ctx, 0, 0, key, fnc, fnc_value, out)); + err = edit_start (ctx, 0, 0, key, fnc, fnc_value, out); + return err; } @@ -173,11 +176,14 @@ gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out) { + gpgme_error_t err; + TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit_start", ctx, "key=%p (%s), fnc=%p fnc_value=%p, out=%p", key, (key->subkeys && key->subkeys->fpr) ? key->subkeys->fpr : "invalid", fnc, fnc_value, out); - return TRACE_ERR (edit_start (ctx, 0, 1, key, fnc, fnc_value, out)); + err = edit_start (ctx, 0, 1, key, fnc, fnc_value, out); + return err; } diff --git a/src/encrypt-sign.c b/src/encrypt-sign.c index a381cfc..02af179 100644 --- a/src/encrypt-sign.c +++ b/src/encrypt-sign.c @@ -92,6 +92,8 @@ gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, gpgme_key_t recp[], gpgme_encrypt_flags_t flags, gpgme_data_t plain, gpgme_data_t cipher) { + gpgme_error_t err; + TRACE_BEG3 (DEBUG_CTX, "gpgme_op_encrypt_sign_start", ctx, "flags=0x%x, plain=%p, cipher=%p", flags, plain, cipher); @@ -108,7 +110,8 @@ gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, gpgme_key_t recp[], } } - return TRACE_ERR (encrypt_sign_start (ctx, 0, recp, flags, plain, cipher)); + err = encrypt_sign_start (ctx, 0, recp, flags, plain, cipher); + return err; } diff --git a/src/encrypt.c b/src/encrypt.c index 1219792..c9599b5 100644 --- a/src/encrypt.c +++ b/src/encrypt.c @@ -227,6 +227,8 @@ gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[], gpgme_encrypt_flags_t flags, gpgme_data_t plain, gpgme_data_t cipher) { + gpgme_error_t err; + TRACE_BEG3 (DEBUG_CTX, "gpgme_op_encrypt_start", ctx, "flags=0x%x, plain=%p, cipher=%p", flags, plain, cipher); @@ -243,7 +245,8 @@ gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[], } } - return TRACE_ERR (encrypt_start (ctx, 0, recp, flags, plain, cipher)); + err = encrypt_start (ctx, 0, recp, flags, plain, cipher); + return TRACE_ERR (err); } diff --git a/src/export.c b/src/export.c index d57dc68..16d9612 100644 --- a/src/export.c +++ b/src/export.c @@ -75,9 +75,12 @@ gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern, gpgme_export_mode_t mode, gpgme_data_t keydata) { + gpgme_error_t err; + TRACE_BEG3 (DEBUG_CTX, "gpgme_op_export_start", ctx, "pattern=%s, mode=0x%x, keydata=%p", pattern, mode, keydata); - return TRACE_ERR (export_start (ctx, 0, pattern, mode, keydata)); + err = export_start (ctx, 0, pattern, mode, keydata); + return TRACE_ERR (err); } @@ -134,6 +137,8 @@ gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx, const char *pattern[], gpgme_export_mode_t mode, gpgme_data_t keydata) { + gpgme_error_t err; + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_export_ext_start", ctx, "mode=0x%x, keydata=%p", mode, keydata); @@ -148,7 +153,8 @@ gpgme_op_export_ext_start (gpgme_ctx_t ctx, const char *pattern[], } } - return TRACE_ERR (export_ext_start (ctx, 0, pattern, mode, keydata)); + err = export_ext_start (ctx, 0, pattern, mode, keydata); + return TRACE_ERR (err); } @@ -244,6 +250,8 @@ gpgme_op_export_keys_start (gpgme_ctx_t ctx, gpgme_export_mode_t mode, gpgme_data_t keydata) { + gpg_error_t err; + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_export_keys_start", ctx, "mode=0x%x, keydata=%p", mode, keydata); @@ -260,7 +268,8 @@ gpgme_op_export_keys_start (gpgme_ctx_t ctx, } } - return TRACE_ERR (export_keys_start (ctx, 0, keys, mode, keydata)); + err = export_keys_start (ctx, 0, keys, mode, keydata); + return TRACE_ERR (err); } gpgme_error_t @@ -290,6 +299,6 @@ gpgme_op_export_keys (gpgme_ctx_t ctx, err = export_keys_start (ctx, 1, keys, mode, keydata); if (!err) err = _gpgme_wait_one (ctx); - return err; + return TRACE_ERR (err); } diff --git a/src/genkey.c b/src/genkey.c index 32c6f36..aaf3e20 100644 --- a/src/genkey.c +++ b/src/genkey.c @@ -197,10 +197,13 @@ gpgme_error_t gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms, gpgme_data_t pubkey, gpgme_data_t seckey) { + gpgme_error_t err; + TRACE_BEG2 (DEBUG_CTX, "gpgme_op_genkey_start", ctx, "pubkey=%p, seckey=%p", pubkey, seckey); TRACE_LOGBUF (parms, strlen (parms)); - return TRACE_ERR (genkey_start (ctx, 0, parms, pubkey, seckey)); + err = genkey_start (ctx, 0, parms, pubkey, seckey); + return TRACE_ERR (err); } diff --git a/src/getauditlog.c b/src/getauditlog.c index a16c51f..6bd5cd7 100644 --- a/src/getauditlog.c +++ b/src/getauditlog.c @@ -1,3 +1,4 @@ + /* getauditlog.c - Retrieve the audit log. Copyright (C) 2007 g10 Code GmbH @@ -63,9 +64,11 @@ gpgme_error_t gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_data_t output, unsigned int flags) { + gpg_error_t err; TRACE_BEG2 (DEBUG_CTX, "gpgme_op_getauditlog_start", ctx, "output=%p, flags=0x%x", output, flags); - return TRACE_ERR (getauditlog_start (ctx, 0, output, flags)); + err = getauditlog_start (ctx, 0, output, flags); + return TRACE_ERR (err); } diff --git a/src/gpgme-tool.c b/src/gpgme-tool.c index 307558a..54d793c 100644 --- a/src/gpgme-tool.c +++ b/src/gpgme-tool.c @@ -1041,7 +1041,7 @@ gt_vfs_mount (gpgme_tool_t gt, const char *container_file, gpg_error_t err; gpg_error_t op_err; err = gpgme_op_vfs_mount (gt->ctx, container_file, mount_dir, flags, &op_err); - return err || op_err; + return err ? err : op_err; } @@ -1053,7 +1053,7 @@ gt_vfs_create (gpgme_tool_t gt, const char *container_file, int flags) err = gpgme_op_vfs_create (gt->ctx, gt->recipients, container_file, flags, &op_err); gt_recipients_clear (gt); - return err || op_err; + return err ? err : op_err; } diff --git a/src/import.c b/src/import.c index f4aef2f..ffab955 100644 --- a/src/import.c +++ b/src/import.c @@ -283,10 +283,13 @@ _gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata) gpgme_error_t gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata) { + gpg_error_t err; + TRACE_BEG1 (DEBUG_CTX, "gpgme_op_import_start", ctx, "keydata=%p", keydata); - return TRACE_ERR (_gpgme_op_import_start (ctx, 0, keydata)); + err = _gpgme_op_import_start (ctx, 0, keydata); + return TRACE_ERR (err); } @@ -358,6 +361,8 @@ _gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous, gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t *keys) { + gpg_error_t err; + TRACE_BEG (DEBUG_CTX, "gpgme_op_import_keys_start", ctx); if (_gpgme_debug_trace () && keys) { @@ -372,7 +377,8 @@ gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t *keys) } } - return TRACE_ERR (_gpgme_op_import_keys_start (ctx, 0, keys)); + err = _gpgme_op_import_keys_start (ctx, 0, keys); + return TRACE_ERR (err); } diff --git a/src/opassuan.c b/src/opassuan.c index d015472..0c535dc 100644 --- a/src/opassuan.c +++ b/src/opassuan.c @@ -69,15 +69,16 @@ gpgme_op_assuan_transact_start (gpgme_ctx_t ctx, gpgme_assuan_status_cb_t status_cb, void *status_cb_value) { + gpg_error_t err; + TRACE_BEG7 (DEBUG_CTX, "gpgme_op_assuan_transact_start", ctx, "command=%s, data_cb=%p/%p, inq_cb=%p/%p, status_cb=%p/%p", command, data_cb, data_cb_value, inq_cb, inq_cb_value, status_cb, status_cb_value); - return TRACE_ERR (opassuan_start (ctx, 0, command, - data_cb, data_cb_value, - inq_cb, inq_cb_value, - status_cb, status_cb_value)); + err = opassuan_start (ctx, 0, command, data_cb, data_cb_value, + inq_cb, inq_cb_value, status_cb, status_cb_value); + return TRACE_ERR (err); } diff --git a/src/sign.c b/src/sign.c index 0c85d0a..c66f06a 100644 --- a/src/sign.c +++ b/src/sign.c @@ -386,9 +386,11 @@ gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, gpgme_sig_mode_t mode) { + gpg_error_t err; TRACE_BEG3 (DEBUG_CTX, "gpgme_op_sign_start", ctx, "plain=%p, sig=%p, mode=%i", plain, sig, mode); - return TRACE_ERR (sign_start (ctx, 0, plain, sig, mode)); + err = sign_start (ctx, 0, plain, sig, mode); + return TRACE_ERR (err); } diff --git a/src/verify.c b/src/verify.c index 41b0a0f..ab74ec2 100644 --- a/src/verify.c +++ b/src/verify.c @@ -832,10 +832,12 @@ gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext) { + gpg_error_t err; TRACE_BEG3 (DEBUG_CTX, "gpgme_op_verify_start", ctx, "sig=%p, signed_text=%p, plaintext=%p", sig, signed_text, plaintext); - return TRACE_ERR (verify_start (ctx, 0, sig, signed_text, plaintext)); + err = verify_start (ctx, 0, sig, signed_text, plaintext); + return TRACE_ERR (err); } diff --git a/src/vfs-create.c b/src/vfs-create.c index a965a96..9a65e0c 100644 --- a/src/vfs-create.c +++ b/src/vfs-create.c @@ -170,6 +170,8 @@ gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[], const char *container_file, unsigned int flags, gpgme_error_t *op_err) { + gpg_error_t err; + TRACE_BEG3 (DEBUG_CTX, "gpgme_op_vfs_create", ctx, "container_file=%s, flags=0x%x, op_err=%p", container_file, flags, op_err); @@ -177,7 +179,7 @@ gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[], if (_gpgme_debug_trace () && recp) { int i = 0; - + while (recp[i]) { TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i], @@ -187,7 +189,7 @@ gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[], } } - return TRACE_ERR (_gpgme_op_vfs_create (ctx, recp, container_file, - flags, op_err)); + err = _gpgme_op_vfs_create (ctx, recp, container_file, flags, op_err); + return TRACE_ERR (err); } diff --git a/src/vfs-mount.c b/src/vfs-mount.c index 3c0b6f2..85a92ad 100644 --- a/src/vfs-mount.c +++ b/src/vfs-mount.c @@ -201,10 +201,12 @@ gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file, const char *mount_dir, unsigned int flags, gpgme_error_t *op_err) { + gpg_error_t err; + TRACE_BEG4 (DEBUG_CTX, "gpgme_op_vfs_mount", ctx, "container=%s, mount_dir=%s, flags=0x%x, op_err=%p", container_file, mount_dir, flags, op_err); - return TRACE_ERR (_gpgme_op_vfs_mount (ctx, container_file, mount_dir, - flags, op_err)); + err = _gpgme_op_vfs_mount (ctx, container_file, mount_dir, flags, op_err); + return TRACE_ERR (err); } -- 2.26.2