aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-assuan.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-06-07 09:17:53 +0000
committerWerner Koch <[email protected]>2019-06-07 09:17:53 +0000
commit52d8ed8dfb91a2b302c20bee27e9a28b7cb6a518 (patch)
tree427ee906e5d794a4aacaceac7fdfaf3dd79eb180 /src/engine-assuan.c
parenttests: Minor fix to run-threaded.c. (diff)
downloadgpgme-52d8ed8dfb91a2b302c20bee27e9a28b7cb6a518.tar.gz
gpgme-52d8ed8dfb91a2b302c20bee27e9a28b7cb6a518.zip
core: Replace the posix close notify mechanism by a new generic one.
* src/fdtable.c, src/fdtable.h: New. * src/posix-io.c (notify_table_item_s): Remove. (notify_table, notify_table_size, notify_table_lock): Remove. (_gpgme_io_pipe): Put new fds into the table. (_gpgme_io_dup): Ditto. (_gpgme_io_close): Replace notify stuff by a call to the fdtable. (_gpgme_io_set_close_notify): Remove. Change all callers to to use _gpgme_fdtable_add_close_notify. * src/Makefile.am (main_sources): Add new files. -- This is the first part or a larger change to unify the tracking of file descriptors. Right now this has only been implemented for Posix and thus the code will not yet build for Windows. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/engine-assuan.c')
-rw-r--r--src/engine-assuan.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/engine-assuan.c b/src/engine-assuan.c
index 497397db..0cca9e59 100644
--- a/src/engine-assuan.c
+++ b/src/engine-assuan.c
@@ -145,7 +145,7 @@ llass_get_req_version (void)
}
-static void
+static gpg_error_t
close_notify_handler (int fd, void *opaque)
{
engine_llass_t llass = opaque;
@@ -158,6 +158,7 @@ close_notify_handler (int fd, void *opaque)
llass->status_cb.fd = -1;
llass->status_cb.tag = NULL;
}
+ return 0;
}
@@ -720,8 +721,8 @@ start (engine_llass_t llass, const char *command)
if (llass->status_cb.fd < 0)
return gpg_error_from_syserror ();
- if (_gpgme_io_set_close_notify (llass->status_cb.fd,
- close_notify_handler, llass))
+ if (_gpgme_fdtable_add_close_notify (llass->status_cb.fd,
+ close_notify_handler, llass))
{
_gpgme_io_close (llass->status_cb.fd);
llass->status_cb.fd = -1;