[svn] gpgme - r1418 - trunk/src
svn author marcus
cvs at cvs.gnupg.org
Thu Nov 5 03:39:32 CET 2009
Author: marcus
Date: 2009-11-05 03:39:31 +0100 (Thu, 05 Nov 2009)
New Revision: 1418
Modified:
trunk/src/ChangeLog
trunk/src/assuan-support.c
trunk/src/posix-io.c
trunk/src/priv-io.h
trunk/src/w32-glib-io.c
trunk/src/w32-io.c
Log:
2009-11-05 Marcus Brinkmann <marcus at g10code.de>
* priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
* w32-io.c (_gpgme_io_spawn): Implement this flag.
* posix-io.c (_gpgme_io_spawn): Likewise.
* w32-glib-io.c (_gpgme_io_spawn): Likewise.
* assuan-support.c (my_spawn): Set this flag.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-11-05 02:17:07 UTC (rev 1417)
+++ trunk/src/ChangeLog 2009-11-05 02:39:31 UTC (rev 1418)
@@ -1,5 +1,11 @@
2009-11-05 Marcus Brinkmann <marcus at g10code.de>
+ * priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
+ * w32-io.c (_gpgme_io_spawn): Implement this flag.
+ * posix-io.c (_gpgme_io_spawn): Likewise.
+ * w32-glib-io.c (_gpgme_io_spawn): Likewise.
+ * assuan-support.c (my_spawn): Set this flag.
+
* decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro.
* decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise.
* delete.c (gpgme_op_delete_start): Likewise.
Modified: trunk/src/assuan-support.c
===================================================================
--- trunk/src/assuan-support.c 2009-11-05 02:17:07 UTC (rev 1417)
+++ trunk/src/assuan-support.c 2009-11-05 02:39:31 UTC (rev 1418)
@@ -152,7 +152,7 @@
fd_items[i].fd = -1;
fd_items[i].dup_to = -1;
- err = _gpgme_io_spawn (name, argv, 0, fd_items, r_pid);
+ err = _gpgme_io_spawn (name, argv, IOSPAWN_FLAG_NOCLOSE, fd_items, r_pid);
if (! err)
{
i = 0;
Modified: trunk/src/posix-io.c
===================================================================
--- trunk/src/posix-io.c 2009-11-05 02:17:07 UTC (rev 1417)
+++ trunk/src/posix-io.c 2009-11-05 02:39:31 UTC (rev 1418)
@@ -454,7 +454,8 @@
for (i = 0; fd_list[i].fd != -1; i++)
{
- _gpgme_io_close (fd_list[i].fd);
+ if (! (flags & IOSPAWN_FLAG_NOCLOSE))
+ _gpgme_io_close (fd_list[i].fd);
/* No handle translation. */
fd_list[i].peer_name = fd_list[i].fd;
}
Modified: trunk/src/priv-io.h
===================================================================
--- trunk/src/priv-io.h 2009-11-05 02:17:07 UTC (rev 1417)
+++ trunk/src/priv-io.h 2009-11-05 02:39:31 UTC (rev 1418)
@@ -68,6 +68,8 @@
/* A flag to tell the spawn function to allow the child process to set
the foreground window. */
#define IOSPAWN_FLAG_ALLOW_SET_FG 1
+/* Don't close any child FDs. */
+#define IOSPAWN_FLAG_NOCLOSE 2
/* Spawn the executable PATH with ARGV as arguments. After forking
close all fds except for those in FD_LIST in the child, then
Modified: trunk/src/w32-glib-io.c
===================================================================
--- trunk/src/w32-glib-io.c 2009-11-05 02:17:07 UTC (rev 1417)
+++ trunk/src/w32-glib-io.c 2009-11-05 02:39:31 UTC (rev 1418)
@@ -777,8 +777,11 @@
TRACE_LOG1 ("CloseHandle of process failed: ec=%d",
(int) GetLastError ());
- for (i = 0; fd_list[i].fd != -1; i++)
- _gpgme_io_close (fd_list[i].fd);
+ if (! (flags & IOSPAWN_FLAG_NOCLOSE))
+ {
+ for (i = 0; fd_list[i].fd != -1; i++)
+ _gpgme_io_close (fd_list[i].fd);
+ }
for (i = 0; fd_list[i].fd != -1; i++)
if (fd_list[i].dup_to == -1)
Modified: trunk/src/w32-io.c
===================================================================
--- trunk/src/w32-io.c 2009-11-05 02:17:07 UTC (rev 1417)
+++ trunk/src/w32-io.c 2009-11-05 02:39:31 UTC (rev 1418)
@@ -1234,8 +1234,11 @@
TRACE_LOG1 ("CloseHandle of process failed: ec=%d",
(int) GetLastError ());
- for (i = 0; fd_list[i].fd != -1; i++)
- _gpgme_io_close (fd_list[i].fd);
+ if (! (flags & IOSPAWN_FLAG_NOCLOSE))
+ {
+ for (i = 0; fd_list[i].fd != -1; i++)
+ _gpgme_io_close (fd_list[i].fd);
+ }
for (i = 0; fd_list[i].fd != -1; i++)
if (fd_list[i].dup_to == -1)
More information about the Gnupg-commits
mailing list