[svn] gpgme - r1266 - in trunk: . assuan gpgme tests tests/gpg

svn author marcus cvs at cvs.gnupg.org
Thu Sep 27 15:02:04 CEST 2007


Author: marcus
Date: 2007-09-27 15:01:54 +0200 (Thu, 27 Sep 2007)
New Revision: 1266

Modified:
   trunk/ChangeLog
   trunk/assuan/assuan-pipe-connect.c
   trunk/gpgme/ChangeLog
   trunk/gpgme/gpgme.h
   trunk/gpgme/w32-glib-io.c
   trunk/gpgme/w32-io.c
   trunk/gpgme/w32-qt-io.cpp
   trunk/tests/ChangeLog
   trunk/tests/gpg/Makefile.am
   trunk/tests/gpg/t-support.h
   trunk/tests/gpg/t-wait.c
   trunk/tests/t-engine-info.c
Log:
2007-09-27  Marcus Brinkmann  <marcus at g10code.de>

	* assuan-pipe-connect.c (pipe_connect_gpgme): Do not close process
	handle here.  Use this function also on Unix systems.

gpgme/
2007-09-27  Marcus Brinkmann  <marcus at g10code.de>

	* w32-glib-io.c (_gpgme_io_spawn),
	w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
	the process handle, return 0.

tests/
2007-09-27  Marcus Brinkmann  <marcus at g10code.de>

	* t-engine-info.c (check_engine_info): Fix debug output.
	* gpg/Makefile.am (tests_unix): New variable.
	(TESTS): Use it.
	* gpg/t-support.h (passphrase_cb) [HAVE_W32_SYSTEM]: Use WriteFile instead of write.
	* gpg/t-wait.c [HAVE_W32_SYSTEM]: Define sleep as _sleep.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/ChangeLog	2007-09-27 13:01:54 UTC (rev 1266)
@@ -1,5 +1,8 @@
 2007-09-27  Marcus Brinkmann  <marcus at g10code.de>
 
+	* assuan-pipe-connect.c (pipe_connect_gpgme): Do not close process
+	handle here.  Use this function also on Unix systems.
+
 	* assuan-pipe-connect.c (pipe_connect_gpgme): Fix last change.
 
 	* assuan-pipe-connect.c (pipe_connect_gpgme): New function, use it

Modified: trunk/assuan/assuan-pipe-connect.c
===================================================================
--- trunk/assuan/assuan-pipe-connect.c	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/assuan/assuan-pipe-connect.c	2007-09-27 13:01:54 UTC (rev 1266)
@@ -181,6 +181,8 @@
 }
 
 
+#ifndef _ASSUAN_IN_GPGME_BUILD_ASSUAN
+
 #ifndef HAVE_W32_SYSTEM
 #define pipe_connect pipe_connect_unix
 /* Unix version of the pipe connection code.  We use an extra macro to
@@ -365,6 +367,7 @@
   return initial_handshake (ctx);
 }
 #endif /*!HAVE_W32_SYSTEM*/
+#endif /* _ASSUAN_IN_GPGME_BUILD_ASSUAN */
 
 
 #ifndef HAVE_W32_SYSTEM
@@ -550,6 +553,7 @@
 
 
 
+
 #ifdef _ASSUAN_IN_GPGME_BUILD_ASSUAN
 
 #define pipe_connect pipe_connect_gpgme
@@ -570,7 +574,7 @@
 		    void *atforkvalue)
 {
   assuan_error_t err;
-  int pid;
+  int res;
   int rp[2];
   int wp[2];
   char mypidstr[50];
@@ -631,8 +635,8 @@
   child_fds[2].fd = -1;
 
   /* Start the process.  */
-  pid = _gpgme_io_spawn (name, argv, child_fds, child_fds);
-  if (pid == -1)
+  res = _gpgme_io_spawn (name, argv, child_fds, child_fds);
+  if (res == -1)
     {
       _assuan_log_printf ("CreateProcess failed: %s\n", strerror (errno));
       _gpgme_io_close (rp[0]);
@@ -642,12 +646,8 @@
       return _assuan_error (ASSUAN_General_Error);
     }
 
-  /* ERR contains the PID.  */
   (*ctx)->pid = 0;  /* We don't use the PID. */
 
-  /* FIXME: Should be done by GPGME.  */
-  CloseHandle ((HANDLE) pid); /* We don't need to wait for the process. */
-
   return initial_handshake (ctx);
 }
 

Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/gpgme/ChangeLog	2007-09-27 13:01:54 UTC (rev 1266)
@@ -1,5 +1,9 @@
 2007-09-27  Marcus Brinkmann  <marcus at g10code.de>
 
+	* w32-glib-io.c (_gpgme_io_spawn),
+	w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
+	the process handle, return 0.
+
 	* gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
 	* gpgme.c (gpgme_get_protocol_name): Implement support for
 	GPGME_PROTOCOL_UNKNOWN.

Modified: trunk/gpgme/gpgme.h
===================================================================
--- trunk/gpgme/gpgme.h	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/gpgme/gpgme.h	2007-09-27 13:01:54 UTC (rev 1266)
@@ -73,7 +73,7 @@
    AM_PATH_GPGME macro) check that this header matches the installed
    library.  Warning: Do not edit the next line.  configure will do
    that for you!  */
-#define GPGME_VERSION "1.1.6-svn1258"
+#define GPGME_VERSION "1.1.6-svn1264"
 
 
 

Modified: trunk/gpgme/w32-glib-io.c
===================================================================
--- trunk/gpgme/w32-glib-io.c	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/gpgme/w32-glib-io.c	2007-09-27 13:01:54 UTC (rev 1266)
@@ -576,7 +576,11 @@
 		(int) GetLastError ());
 
   TRACE_SUC1 ("process=%p", pi.hProcess);
-  return 0;
+
+  /* We don't need to wait for the process. */
+  CloseHandle (pi.hProcess);
+
+  return TRACE_SYSRES (0);
 }
 
 

Modified: trunk/gpgme/w32-io.c
===================================================================
--- trunk/gpgme/w32-io.c	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/gpgme/w32-io.c	2007-09-27 13:01:54 UTC (rev 1266)
@@ -1156,7 +1156,11 @@
 		(int) GetLastError ());
 
   TRACE_SUC1 ("process=%p", pi.hProcess);
-  return handle_to_pid (pi.hProcess);
+
+  /* We don't need to wait for the process. */
+  CloseHandle (pi.hProcess);
+
+  return TRACE_SYSRES (0);
 }
 
 

Modified: trunk/gpgme/w32-qt-io.cpp
===================================================================
--- trunk/gpgme/w32-qt-io.cpp	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/gpgme/w32-qt-io.cpp	2007-09-27 13:01:54 UTC (rev 1266)
@@ -525,7 +525,11 @@
 		(int) GetLastError ());
 
   TRACE_SUC1 ("process=%p", pi.hProcess);
-  return 0;
+
+  /* We don't need to wait for the process. */
+  CloseHandle (pi.hProcess);
+
+  return TRACE_SYSRES (0);
 }
 
 

Modified: trunk/tests/ChangeLog
===================================================================
--- trunk/tests/ChangeLog	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/tests/ChangeLog	2007-09-27 13:01:54 UTC (rev 1266)
@@ -1,3 +1,11 @@
+2007-09-27  Marcus Brinkmann  <marcus at g10code.de>
+
+	* t-engine-info.c (check_engine_info): Fix debug output.
+	* gpg/Makefile.am (tests_unix): New variable.
+	(TESTS): Use it.
+	* gpg/t-support.h (passphrase_cb) [HAVE_W32_SYSTEM]: Use WriteFile instead of write.
+	* gpg/t-wait.c [HAVE_W32_SYSTEM]: Define sleep as _sleep.
+
 2007-09-14  Marcus Brinkmann  <marcus at g10code.de>
 
 	* gpgsm/t-verify.c (main): Release TEXT and SIG.

Modified: trunk/tests/gpg/Makefile.am
===================================================================
--- trunk/tests/gpg/Makefile.am	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/tests/gpg/Makefile.am	2007-09-27 13:01:54 UTC (rev 1266)
@@ -25,12 +25,18 @@
 
 # The keylist tests must come after the import and the edit test.
 noinst_HEADERS = t-support.h
-TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers	\
-	t-decrypt t-verify t-decrypt-verify t-sig-notation \
-	t-export t-import t-trustlist t-eventloop t-edit \
-	t-keylist t-keylist-sig t-thread1 t-wait t-encrypt-large \
-	t-file-name
 
+if HAVE_W32_SYSTEM
+tests_unix =
+else
+tests_unix = t-eventloop t-thread1
+endif
+
+TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers		\
+	t-decrypt t-verify t-decrypt-verify t-sig-notation t-export	\
+	t-import t-trustlist t-edit t-keylist t-keylist-sig t-wait	\
+	t-encrypt-large t-file-name $(tests_unix)
+
 CLEANFILES = secring.gpg pubring.gpg trustdb.gpg
 DISTCLEANFILES = pubring.gpg~ random_seed gpg.conf
 

Modified: trunk/tests/gpg/t-support.h
===================================================================
--- trunk/tests/gpg/t-support.h	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/tests/gpg/t-support.h	2007-09-27 13:01:54 UTC (rev 1266)
@@ -24,6 +24,10 @@
 #include <stdlib.h>
 #include <locale.h>
 
+#ifdef HAVE_W32_SYSTEM
+#include <windows.h>
+#endif
+
 #include <gpgme.h>
 
 #ifndef DIM
@@ -65,7 +69,13 @@
 passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info,
 	       int last_was_bad, int fd)
 {
+#ifdef HAVE_W32_SYSTEM
+  DWORD written;
+  WriteFile ((HANDLE) fd, "abc\n", 4, &written, 0);
+#else
   write (fd, "abc\n", 4);
+#endif
+
   return 0;
 }
 

Modified: trunk/tests/gpg/t-wait.c
===================================================================
--- trunk/tests/gpg/t-wait.c	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/tests/gpg/t-wait.c	2007-09-27 13:01:54 UTC (rev 1266)
@@ -1,6 +1,6 @@
 /* t-wait.c - Regression test.
    Copyright (C) 2000 Werner Koch (dd9jn)
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
 
    This file is part of GPGME.
  
@@ -29,6 +29,10 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef HAVE_W32_SYSTEM
+#define sleep _sleep
+#endif
+
 #include <gpgme.h>
 
 #include "t-support.h"

Modified: trunk/tests/t-engine-info.c
===================================================================
--- trunk/tests/t-engine-info.c	2007-09-27 12:17:24 UTC (rev 1265)
+++ trunk/tests/t-engine-info.c	2007-09-27 13:01:54 UTC (rev 1266)
@@ -1,5 +1,5 @@
 /* t-engine-info.c - Regression test for gpgme_get_engine_info.
-   Copyright (C) 2003, 2004 g10 Code GmbH
+   Copyright (C) 2003, 2004, 2007 g10 Code GmbH
 
    This file is part of GPGME.
  
@@ -54,13 +54,13 @@
     }
   if (strcmp (info->file_name, file_name))
     {
-      fprintf (stderr, "Unexpected file name to executable %s (expected %s instead)",
+      fprintf (stderr, "Unexpected file name to executable %s (expected %s instead)\n",
 	       info->file_name, file_name);
       exit (1);
     }
   if (strcmp (info->req_version, req_version))
     {
-      fprintf (stderr, "Unexpected required version %s (expected %s instead)",
+      fprintf (stderr, "Unexpected required version %s (expected %s instead)\n",
 	       info->req_version, req_version);
       exit (1);
     }




More information about the Gnupg-commits mailing list