[svn] gpgme - r1135 - trunk/gpgme

svn author marcus cvs at cvs.gnupg.org
Thu Nov 17 17:12:28 CET 2005


Author: marcus
Date: 2005-11-17 17:12:27 +0100 (Thu, 17 Nov 2005)
New Revision: 1135

Modified:
   trunk/gpgme/ChangeLog
   trunk/gpgme/posix-io.c
   trunk/gpgme/priv-io.h
   trunk/gpgme/w32-io.c
Log:
2005-11-17  Marcus Brinkmann  <marcus at g10code.de>

	* priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
	* w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
	* posix-io.c (_gpgme_io_kill): Removed.
	(_gpgme_io_waitpid): Declare static.


Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog	2005-11-15 16:04:28 UTC (rev 1134)
+++ trunk/gpgme/ChangeLog	2005-11-17 16:12:27 UTC (rev 1135)
@@ -1,3 +1,10 @@
+2005-11-17  Marcus Brinkmann  <marcus at g10code.de>
+
+	* priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
+	* w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
+	* posix-io.c (_gpgme_io_kill): Removed.
+	(_gpgme_io_waitpid): Declare static.
+
 2005-10-24  Marcus Brinkmann  <marcus at g10code.de>
 
 	* w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.

Modified: trunk/gpgme/posix-io.c
===================================================================
--- trunk/gpgme/posix-io.c	2005-11-15 16:04:28 UTC (rev 1134)
+++ trunk/gpgme/posix-io.c	2005-11-17 16:12:27 UTC (rev 1135)
@@ -174,6 +174,30 @@
 }
 
 
+static int
+_gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal)
+{
+  int status;
+
+  *r_status = 0;
+  *r_signal = 0;
+  if (_gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG) == pid)
+    {
+      if (WIFSIGNALED (status))
+	{
+	  *r_status = 4; /* Need some value here.  */
+	  *r_signal = WTERMSIG (status);
+	}
+      else if (WIFEXITED (status))
+	*r_status = WEXITSTATUS (status);
+      else
+	*r_status = 4; /* Oops.  */
+      return 1;
+    }
+  return 0;
+}
+
+
 /* Returns 0 on success, -1 on error.  */
 int
 _gpgme_io_spawn (const char *path, char **argv,
@@ -273,37 +297,6 @@
 }
 
 
-int
-_gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal)
-{
-  int status;
-
-  *r_status = 0;
-  *r_signal = 0;
-  if (_gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG) == pid)
-    {
-      if (WIFSIGNALED (status))
-	{
-	  *r_status = 4; /* Need some value here.  */
-	  *r_signal = WTERMSIG (status);
-	}
-      else if (WIFEXITED (status))
-	*r_status = WEXITSTATUS (status);
-      else
-	*r_status = 4; /* Oops.  */
-      return 1;
-    }
-  return 0;
-}
-
-
-int
-_gpgme_io_kill (int pid, int hard)
-{
-  return kill (pid, hard ? SIGKILL : SIGTERM);
-}
-
-
 /*
  * Select on the list of fds.
  * Returns: -1 = error

Modified: trunk/gpgme/priv-io.h
===================================================================
--- trunk/gpgme/priv-io.h	2005-11-15 16:04:28 UTC (rev 1134)
+++ trunk/gpgme/priv-io.h	2005-11-17 16:12:27 UTC (rev 1135)
@@ -57,8 +57,6 @@
 int _gpgme_io_spawn (const char *path, char **argv,
 		     struct spawn_fd_item_s *fd_child_list,
 		     struct spawn_fd_item_s *fd_parent_list);
-int _gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal);
-int _gpgme_io_kill (int pid, int hard);
 int _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock);
 
 #endif /* IO_H */

Modified: trunk/gpgme/w32-io.c
===================================================================
--- trunk/gpgme/w32-io.c	2005-11-15 16:04:28 UTC (rev 1134)
+++ trunk/gpgme/w32-io.c	2005-11-17 16:12:27 UTC (rev 1135)
@@ -942,60 +942,6 @@
 }
 
 
-
-
-int
-_gpgme_io_waitpid ( int pid, int hang, int *r_status, int *r_signal )
-{
-    HANDLE proc = fd_to_handle (pid);
-    int code, ret = 0;
-    DWORD exc;
-
-    *r_status = 0;
-    *r_signal = 0;
-    code = WaitForSingleObject ( proc, hang? INFINITE : 0 );
-    switch (code) {
-      case WAIT_FAILED:
-        DEBUG2 ("WFSO pid=%d failed: %d\n", (int)pid, (int)GetLastError () );
-        break;
-
-      case WAIT_OBJECT_0:
-        if (!GetExitCodeProcess (proc, &exc)) {
-            DEBUG2 ("** GECP pid=%d failed: ec=%d\n",
-                    (int)pid, (int)GetLastError () );
-            *r_status = 4; 
-        }
-        else {
-            DEBUG2 ("GECP pid=%d exit code=%d\n", (int)pid,  exc);
-            *r_status = exc;
-        }
-        ret = 1;
-        break;
-
-      case WAIT_TIMEOUT:
-        if (hang)
-            DEBUG1 ("WFSO pid=%d timed out\n", (int)pid);
-        break;
-
-      default:
-        DEBUG2 ("WFSO pid=%d returned %d\n", (int)pid, code );
-        break;
-    }
-    return ret;
-}
-
-int
-_gpgme_io_kill ( int pid, int hard )
-{
-    HANDLE proc = fd_to_handle (pid);
-
-    #warning I am not sure how to kill a process
-    /* fixme: figure out how this can be done */
-    return 0;
-}
-
-
-
 /*
  * Select on the list of fds.
  * Returns: -1 = error




More information about the Gnupg-commits mailing list