From: Marcus Brinkmann Date: Fri, 22 Oct 2004 16:55:16 +0000 (+0000) Subject: 2004-10-22 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~381 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8cb3353e480a26c394a5b3ea5f2032f631eb7395;p=gpgme.git 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. --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 7d6c5af..9baaf6e 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/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/trunk/gpgme/engine-gpgsm.c b/trunk/gpgme/engine-gpgsm.c index e08c03c..0138fdf 100644 --- a/trunk/gpgme/engine-gpgsm.c +++ b/trunk/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);