From e2297804cff3de9a176661d0005dc85fd1c84018 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Fri, 22 Oct 2004 16:55:16 +0000 Subject: [PATCH] 2004-10-22 Marcus Brinkmann * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0. (start): Call map_assuan_error on return value of assuan_write_line. --- gpgme/ChangeLog | 6 ++++++ gpgme/engine-gpgsm.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 7d6c5af..9baaf6e 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,9 @@ +2004-10-22 Marcus Brinkmann + + * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0. + (start): Call map_assuan_error on return value of + assuan_write_line. + 2004-10-05 Marcus Brinkmann * op-support.c (_gpgme_op_data_lookup): Use char pointer for diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index e08c03c..0138fdf 100644 --- a/gpgme/engine-gpgsm.c +++ b/gpgme/engine-gpgsm.c @@ -153,6 +153,9 @@ close_notify_handler (int fd, void *opaque) static gpgme_error_t map_assuan_error (AssuanError err) { + if (!err) + return 0; + if (err == -1) return gpg_error (GPG_ERR_INV_ENGINE); @@ -398,6 +401,7 @@ gpgsm_new (void **engine, const char *lc_ctype, const char *lc_messages) err = assuan_pipe_connect (&gpgsm->assuan_ctx, _gpgme_get_gpgsm_path (), argv, child_fds); + /* FIXME: Check error. */ /* We need to know the fd used by assuan for reads. We do this by using the assumption that the first returned fd from @@ -866,7 +870,7 @@ start (engine_gpgsm_t gpgsm, const char *command) err = add_io_cb (gpgsm, &gpgsm->message_cb, _gpgme_data_outbound_handler); if (!err) - err = assuan_write_line (gpgsm->assuan_ctx, command); + err = map_assuan_error (assuan_write_line (gpgsm->assuan_ctx, command)); if (!err) (*gpgsm->io_cbs.event) (gpgsm->io_cbs.event_priv, GPGME_EVENT_START, NULL); -- 2.26.2