[git] Assuan - branch, master, updated. libassuan-2.0.3-3-gcef5514

by Marcus Brinkmann cvs at cvs.gnupg.org
Tue Jan 24 19:48:40 CET 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPC library used by GnuPG".

The branch, master has been updated
       via  cef55142f2552538714f8296479f58a63d14a239 (commit)
      from  e23e6f2bd49f415f4fdca013e4f61e1b17995a51 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cef55142f2552538714f8296479f58a63d14a239
Author: Marcus Brinkmann <marcus.brinkmann at ruhr-uni-bochum.de>
Date:   Tue Jan 24 18:49:57 2012 +0100

    Fix npth port file handle use.
    
    * assuan.h.in (ASSUAN_SYSTEM_NPTH_IMPL): Use npth_unprotect and
    npth_protect with actual assuan functions instead of npth wrappers.
    * libassuan.def: Add __assuan_read, __assuan_write, __assuan_sendmsg,
    __assuan_recvmsg, __assuan_waitpid exports.
    * system-w32.c (__assuan_read, __assuan_write, __assuan_sendmsg,
    __assuan_recvmsg, __assuan_waitpid): Make non-static.

diff --git a/src/assuan.h.in b/src/assuan.h.in
index 2e43c81..69a6a9c 100644
--- a/src/assuan.h.in
+++ b/src/assuan.h.in
@@ -482,6 +482,11 @@ int __assuan_socketpair (assuan_context_t ctx, int _namespace, int style,
 			 int protocol, assuan_fd_t filedes[2]);
 int __assuan_socket (assuan_context_t ctx, int _namespace, int style, int protocol);
 int __assuan_connect (assuan_context_t ctx, int sock, struct sockaddr *addr, socklen_t length);
+ssize_t __assuan_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size);
+ssize_t __assuan_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer, size_t size);
+int __assuan_recvmsg (assuan_context_t ctx, assuan_fd_t fd, assuan_msghdr_t msg, int flags);
+int __assuan_sendmsg (assuan_context_t ctx, assuan_fd_t fd, const assuan_msghdr_t msg, int flags);
+pid_t __assuan_waitpid (assuan_context_t ctx, pid_t pid, int nowait, int *status, int options);
 
 
 #define ASSUAN_SYSTEM_PTH_IMPL						\
@@ -515,21 +520,29 @@ extern struct assuan_system_hooks _assuan_system_pth;
   { (void) ctx; npth_usleep (usec); }					\
   static ssize_t _assuan_npth_read (assuan_context_t ctx, assuan_fd_t fd, \
 				    void *buffer, size_t size)		\
-  { (void) ctx; return npth_read (fd, buffer, size); }			\
+  { ssize_t res; (void) ctx; npth_unprotect();				\
+    res = __assuan_read (ctx, fd, buffer, size);			\
+    npth_protect(); return res; }					\
   static ssize_t _assuan_npth_write (assuan_context_t ctx, assuan_fd_t fd, \
 				     const void *buffer, size_t size)	\
-  { (void) ctx; return npth_write (fd, buffer, size); }			\
+  { ssize_t res; (void) ctx; npth_unprotect();				\
+    res = __assuan_write (ctx, fd, buffer, size);			\
+    npth_protect(); return res; }					\
   static int _assuan_npth_recvmsg (assuan_context_t ctx, assuan_fd_t fd, \
 				  assuan_msghdr_t msg, int flags)	\
-  { (void) ctx; return npth_recvmsg (fd, msg, flags); }			\
+  { int res; (void) ctx; npth_unprotect();				\
+    res = __assuan_recvmsg (ctx, fd, msg, flags);			\
+    npth_protect(); return res; }					\
   static int _assuan_npth_sendmsg (assuan_context_t ctx, assuan_fd_t fd, \
 				  const assuan_msghdr_t msg, int flags) \
-  { (void) ctx; return npth_sendmsg (fd, msg, flags); }			\
+  { int res; (void) ctx; npth_unprotect();				\
+    res = __assuan_sendmsg (ctx, fd, msg, flags);			\
+    npth_protect(); return res; }					\
   static pid_t _assuan_npth_waitpid (assuan_context_t ctx, pid_t pid,	\
 				     int nowait, int *status, int options) \
-  { (void) ctx;								\
-    if (!nowait) return npth_waitpid (pid, status, options);		\
-    else return 0; }							\
+  { pid_t res; (void) ctx; npth_unprotect();				\
+    res = __assuan_waitpid (ctx, pid, nowait, status, options);		\
+    npth_protect(); return res; }					\
 									\
   struct assuan_system_hooks _assuan_system_npth =			\
     { ASSUAN_SYSTEM_HOOKS_VERSION, _assuan_npth_usleep, __assuan_pipe,	\
diff --git a/src/libassuan.def b/src/libassuan.def
index 9287486..b634b1c 100644
--- a/src/libassuan.def
+++ b/src/libassuan.def
@@ -105,6 +105,11 @@ EXPORTS
     __assuan_connect			@84
     assuan_register_pre_cmd_notify	@85
     assuan_socket_connect_fd		@86
+    __assuan_read			@87
+    __assuan_write			@88
+    __assuan_recvmsg			@89
+    __assuan_sendmsg			@90
+    __assuan_waitpid			@91
 
 ; END
 
diff --git a/src/system-w32.c b/src/system-w32.c
index 9753f71..c6ced5e 100644
--- a/src/system-w32.c
+++ b/src/system-w32.c
@@ -190,7 +190,7 @@ is_socket (HANDLE hd)
 }
 
 
-static ssize_t
+ssize_t
 __assuan_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
 {
   int res;
@@ -239,7 +239,7 @@ __assuan_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
 
 
 
-static ssize_t
+ssize_t
 __assuan_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer,
 		size_t size)
 {
@@ -292,7 +292,7 @@ __assuan_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer,
 
 
 
-static int
+int
 __assuan_recvmsg (assuan_context_t ctx, assuan_fd_t fd, assuan_msghdr_t msg,
 		  int flags)
 {
@@ -303,7 +303,7 @@ __assuan_recvmsg (assuan_context_t ctx, assuan_fd_t fd, assuan_msghdr_t msg,
 
 
 
-static int
+int
 __assuan_sendmsg (assuan_context_t ctx, assuan_fd_t fd, assuan_msghdr_t msg,
 		  int flags)
 {
@@ -496,7 +496,7 @@ __assuan_spawn (assuan_context_t ctx, pid_t *r_pid, const char *name,
 
 /* FIXME: Add some sort of waitpid function that covers GPGME and
    gpg-agent's use of assuan.  */
-static pid_t 
+pid_t
 __assuan_waitpid (assuan_context_t ctx, pid_t pid, int nowait,
 		  int *status, int options)
 {

-----------------------------------------------------------------------

Summary of changes:
 src/assuan.h.in   |   27 ++++++++++++++++++++-------
 src/libassuan.def |    5 +++++
 src/system-w32.c  |   10 +++++-----
 3 files changed, 30 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list