summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2017-11-30 17:48:32 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2017-11-30 17:48:32 +0900
commit0b551de6ca57790c511f32755880bbeaa1cacf85 (patch)
treee0c0a011c8bcfdedfddf4dd77d15c864dcec73d2
parenta63c4f33d5c10173dd54e2af32b127aa49498bfe (diff)
downloadlibassuan-0b551de6ca57790c511f32755880bbeaa1cacf85.tar.gz
Wrap assuan_close for nPth.
* src/assuan.h.in (_assuan_npth_close): New. (_assuan_system_npth): Use _assuan_npth_close. -- In some situation, closesocket on Windows may block. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--src/assuan.h.in16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/assuan.h.in b/src/assuan.h.in
index acd4f45..f9eddca 100644
--- a/src/assuan.h.in
+++ b/src/assuan.h.in
@@ -572,15 +572,19 @@ extern struct assuan_system_hooks _assuan_system_pth;
{ pid_t res; (void) ctx; npth_unprotect(); \
res = __assuan_waitpid (ctx, pid, nowait, status, options); \
npth_protect(); return res; } \
- static int _assuan_npth_connect (assuan_context_t ctx, int sock, \
- struct sockaddr *addr, socklen_t len)\
- { int res; npth_unprotect(); \
- res = __assuan_connect (ctx, sock, addr, len); \
- npth_protect(); return res; } \
+ static int _assuan_npth_connect (assuan_context_t ctx, int sock, \
+ struct sockaddr *addr, socklen_t len)\
+ { int res; npth_unprotect(); \
+ res = __assuan_connect (ctx, sock, addr, len); \
+ npth_protect(); return res; } \
+ static int _assuan_npth_close (assuan_context_t ctx, assuan_fd_t fd) \
+ { int res; npth_unprotect(); \
+ res = __assuan_close (ctx, fd); \
+ npth_protect(); return res; } \
\
struct assuan_system_hooks _assuan_system_npth = \
{ ASSUAN_SYSTEM_HOOKS_VERSION, _assuan_npth_usleep, __assuan_pipe, \
- __assuan_close, _assuan_npth_read, _assuan_npth_write, \
+ _assuan_npth_close, _assuan_npth_read, _assuan_npth_write, \
_assuan_npth_recvmsg, _assuan_npth_sendmsg, \
__assuan_spawn, _assuan_npth_waitpid, __assuan_socketpair, \
__assuan_socket, _assuan_npth_connect }