[Pkg-gnupg-commit] [libassuan] 03/07: Wrap assuan_close for nPth.

Eric Dorland eric at moszumanska.debian.org
Sun Dec 3 20:21:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libassuan.

commit 0b551de6ca57790c511f32755880bbeaa1cacf85
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Nov 30 17:48:32 2017 +0900

    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 at fsij.org>
---
 src/assuan.h.in | 16 ++++++++++------
 1 file 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 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git



More information about the Pkg-gnupg-commit mailing list