aboutsummaryrefslogtreecommitdiffstats
path: root/src/wait.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-06-07 10:10:40 +0000
committerWerner Koch <[email protected]>2019-06-07 10:10:40 +0000
commit92883efe7176c2022e25e913c1d2f40c35a0754a (patch)
tree3b6163237f6878a494171f05f6b6d2dd1db0d511 /src/wait.c
parentcore: Replace the posix close notify mechanism by a new generic one. (diff)
downloadgpgme-92883efe7176c2022e25e913c1d2f40c35a0754a.tar.gz
gpgme-92883efe7176c2022e25e913c1d2f40c35a0754a.zip
core: Introduce a context serial number.
* src/context.h: Include stdint.h. (struct gpgme_context): Add field 'serial'. (CTXSERIAL): New. * src/gpgme.c: (last_ctx_serial): New. (gpgme_new): Set serial. * src/gpgme.c: Change trace calls to use the serial. * src/wait.c (_gpgme_add_io_cb): Ditto (_gpgme_remove_io_cb): Ditto. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--src/wait.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wait.c b/src/wait.c
index c76f98f9..52eb6f4d 100644
--- a/src/wait.c
+++ b/src/wait.c
@@ -136,8 +136,8 @@ _gpgme_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc,
return err;
}
- TRACE (DEBUG_CTX, "_gpgme_add_io_cb", ctx,
- "fd=%d, dir=%d -> tag=%p", fd, dir, tag);
+ TRACE (DEBUG_CTX, "_gpgme_add_io_cb", NULL,
+ "ctx=%lu fd=%d dir=%d -> tag=%p", CTXSERIAL (ctx), fd, dir, tag);
*r_tag = tag;
return 0;
@@ -159,9 +159,11 @@ _gpgme_remove_io_cb (void *data)
assert (fdt);
idx = tag->idx;
- TRACE (DEBUG_CTX, "_gpgme_remove_io_cb", data,
- "setting fd 0x%x (item=%p) done", fdt->fds[idx].fd,
- fdt->fds[idx].opaque);
+ TRACE (DEBUG_CTX, "_gpgme_remove_io_cb", NULL,
+ "ctx=%lu setting fd=%d (item=%p data=%p) done",
+ CTXSERIAL (ctx),
+ fdt->fds[idx].fd,
+ fdt->fds[idx].opaque, data);
free (fdt->fds[idx].opaque);
free (tag);