[svn] assuan - r330 - in trunk: . doc src
svn author marcus
cvs at cvs.gnupg.org
Tue Dec 8 13:29:02 CET 2009
Author: marcus
Date: 2009-12-08 13:29:02 +0100 (Tue, 08 Dec 2009)
New Revision: 330
Modified:
trunk/NEWS
trunk/TODO
trunk/doc/ChangeLog
trunk/doc/assuan.texi
trunk/src/ChangeLog
trunk/src/assuan-pipe-connect.c
trunk/src/assuan.h
Log:
doc/
2009-12-08 Marcus Brinkmann <marcus at g10code.de>
* assuan.texi (Contexts): Document ASSUAN_SPAWN_DETACHED.
src/
2009-12-08 Marcus Brinkmann <marcus at g10code.de>
* assuan.h (ASSUAN_SPAWN_DETACHED): New macro.
* assuan-pipe-connect.c (pipe_connect): Calculate spawn_flags from
flags.
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/doc/ChangeLog 2009-12-08 12:29:02 UTC (rev 330)
@@ -1,3 +1,7 @@
+2009-12-08 Marcus Brinkmann <marcus at g10code.de>
+
+ * assuan.texi (Contexts): Document ASSUAN_SPAWN_DETACHED.
+
2009-11-25 Marcus Brinkmann <marcus at g10code.de>
* assuan.texi (Data Types): Document assuan_fdopen.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/src/ChangeLog 2009-12-08 12:29:02 UTC (rev 330)
@@ -1,5 +1,9 @@
2009-12-08 Marcus Brinkmann <marcus at g10code.de>
+ * assuan.h (ASSUAN_SPAWN_DETACHED): New macro.
+ * assuan-pipe-connect.c (pipe_connect): Calculate spawn_flags from
+ flags.
+
* assuan.h (assuan_fd_from_posix_fd): Handle invalid fd early.
* assuan-socket.c (get_nonce): Cast buffer to unsigned.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/NEWS 2009-12-08 12:29:02 UTC (rev 330)
@@ -92,6 +92,7 @@
assuan_client_read_response NEW
assuan_client_parse_response NEW
assuan_fd_from_posix_fd NEW
+ASSUAN_SPAWN_DETACHED NEW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/TODO 2009-12-08 12:29:02 UTC (rev 330)
@@ -1,9 +1,6 @@
-*- outline -*-
* Check that we have Pth-ed all blocking fucntions.
-* When turning libassuan into a shared library, provide a general
- version as well as a Pth-enabled one.
-* Even better, allow replacing all these I/O and spawn functions on
- a per-context basis at runtime (like the old assuan_set_io_hooks but better).
+* Introduce a spawn wrapper program as gpgme has to not leak fds under W32.
* assuan_transact returns immediately on an error in the callback
function. It might be better to return the error to the caller. As
an example see dirmngr-client, where we need to send empty responses
Modified: trunk/doc/assuan.texi
===================================================================
--- trunk/doc/assuan.texi 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/doc/assuan.texi 2009-12-08 12:29:02 UTC (rev 330)
@@ -913,6 +913,16 @@
case, @code{*argv} should be set to @code{"client"} in the parent
process and @code{"server"} in the child process.
+Flags is the bit-wise OR of some (or none) of the following flags:
+
+ at table @code
+ at item ASSUAN_SPAWN_DETACHED
+If set and there is a need to start the server it will be started as a
+background process. This flag is useful under W32 systems, so that no
+new console is created and pops up a console window when starting the
+server.
+ at end table
+
@item pid_t (*waitpid) (assuan_context_t ctx, pid_t pid, int action, int *status, int options)
This is the function called by @sc{Assuan} to wait for the spawned
child process @var{pid} to exit, or, if @var{action} is 1, to just
Modified: trunk/src/assuan-pipe-connect.c
===================================================================
--- trunk/src/assuan-pipe-connect.c 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/src/assuan-pipe-connect.c 2009-12-08 12:29:02 UTC (rev 330)
@@ -154,6 +154,7 @@
pid_t pid;
int res;
struct at_pipe_fork atp;
+ unsigned int spawn_flags;
atp.user_atfork = atfork;
atp.user_atforkvalue = atforkvalue;
@@ -173,10 +174,14 @@
_assuan_close (ctx, rp[1]);
return _assuan_error (ctx, gpg_err_code_from_syserror ());
}
+
+ spawn_flags = 0;
+ if (flags & ASSUAN_PIPE_CONNECT_DETACHED)
+ spawn_flags |= ASSUAN_SPAWN_DETACHED;
/* FIXME: Use atfork handler that closes child fds on Unix. */
res = _assuan_spawn (ctx, &pid, name, argv, wp[0], rp[1],
- fd_child_list, at_pipe_fork_cb, &atp, flags);
+ fd_child_list, at_pipe_fork_cb, &atp, spawn_flags);
if (res < 0)
{
rc = gpg_err_code_from_syserror ();
Modified: trunk/src/assuan.h
===================================================================
--- trunk/src/assuan.h 2009-12-08 04:47:49 UTC (rev 329)
+++ trunk/src/assuan.h 2009-12-08 12:29:02 UTC (rev 330)
@@ -253,6 +253,7 @@
#define ASSUAN_SYSTEM_HOOKS_VERSION 1
+#define ASSUAN_SPAWN_DETACHED 128
struct assuan_system_hooks
{
/* Always set to ASSUAN_SYTEM_HOOKS_VERSION. */
More information about the Gnupg-commits
mailing list