aboutsummaryrefslogtreecommitdiffstats
path: root/src/wait.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-06-06 16:53:23 +0000
committerWerner Koch <[email protected]>2019-06-06 16:57:28 +0000
commit6b9ff1ba391a4364b37cb116748194f3f33b4f12 (patch)
treee34e83867837d9330319d753f910c76bef7b6a07 /src/wait.c
parenttests: Add option "allow-del" to run-threaded (diff)
downloadgpgme-6b9ff1ba391a4364b37cb116748194f3f33b4f12.tar.gz
gpgme-6b9ff1ba391a4364b37cb116748194f3f33b4f12.zip
core: Fix error return value of _gpgme_run_io_cb.
* src/wait.c (_gpgme_run_io_cb): Fix return code. -- The function needs to return an gpg_error_t and not ERRNO. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/wait.c')
-rw-r--r--src/wait.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wait.c b/src/wait.c
index e6161018..c76f98f9 100644
--- a/src/wait.c
+++ b/src/wait.c
@@ -179,7 +179,8 @@ _gpgme_remove_io_cb (void *data)
own event loops could compensate for that, but the external event
loops cannot. FIXME: We may still want to optimize this a bit when
we are called from our own event loops. So if CHECKED is 1, the
- check is skipped. */
+ check is skipped. FIXME: Give an example on how the status of other
+ fds can be influenced. */
gpgme_error_t
_gpgme_run_io_cb (struct io_select_fd_s *an_fds, int checked,
gpgme_error_t *op_err)
@@ -203,11 +204,13 @@ _gpgme_run_io_cb (struct io_select_fd_s *an_fds, int checked,
nr = _gpgme_io_select (&fds, 1, 1);
assert (nr <= 1);
if (nr < 0)
- return errno;
+ return gpg_error_from_syserror ();
else if (nr == 0)
- /* The status changed in the meantime, there is nothing left
- to do. */
- return 0;
+ {
+ /* The status changed in the meantime, there is nothing left
+ * to do. */
+ return 0;
+ }
}
TRACE (DEBUG_CTX, "_gpgme_run_io_cb", item, "handler (%p, %d)",