gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r20432 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r20432 - gnunet/src/util
Date: Sun, 11 Mar 2012 01:00:01 +0100

Author: grothoff
Date: 2012-03-11 01:00:01 +0100 (Sun, 11 Mar 2012)
New Revision: 20432

Modified:
   gnunet/src/util/os_priority.c
Log:
-LRN: Fix kill

Use the same code for killing processes without a control pipe AND
the processes for which a control pipe write has failed.
Use PLIBC_KILL() instead of kill().



Modified: gnunet/src/util/os_priority.c
===================================================================
--- gnunet/src/util/os_priority.c       2012-03-10 23:17:45 UTC (rev 20431)
+++ gnunet/src/util/os_priority.c       2012-03-11 00:00:01 UTC (rev 20432)
@@ -436,20 +436,13 @@
     proc->control_pipe = npipe_open (proc->childpipename,
                                     GNUNET_DISK_OPEN_WRITE);
 #endif
-  if (NULL == proc->control_pipe)
+  if (NULL != proc->control_pipe)
   {
-#if WINDOWS
-    /* no pipe and windows? can't do this */
-    errno = EINVAL;
-    return -1;
-#else
-    return kill (proc->pid, sig);
-#endif    
+    ret = GNUNET_DISK_file_write (proc->control_pipe, &csig, sizeof (csig));
+    if (ret == sizeof (csig))  
+      return 0;
   }
-  ret = GNUNET_DISK_file_write (proc->control_pipe, &csig, sizeof (csig));
-  if (ret == sizeof (csig))  
-    return 0;
-  /* pipe failed, try other methods */
+  /* pipe failed or non-existent, try other methods */
   switch (sig)
   {
 #if !WINDOWS
@@ -473,7 +466,7 @@
     errno = EINVAL;
     return -1;
 #else
-    return kill (proc->pid, sig);
+    return PLIBC_kill (proc->pid, sig);
 #endif    
   }
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]