This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

kill(getpid(), 0) will fail



kill(getpid(), 0) will fail. This is used to check kill() in the
configure script included in rcs-5.7.

kill_worker() passes `myself_nowait_nomain' to proc_exists()
instead of `myself', but proc_exists() takes no account of it.
I believe this is the only case that `myself_nowait_nomain' is
passed to proc_exists().

So the following patch can fix this problem.

--- signal.cc-	Wed Feb 03 13:55:21 1999
+++ signal.cc	Thu Feb 25 13:55:41 1999
@@ -145,17 +145,20 @@ kill_worker (pid_t pid, int sig)
       return -1;
     }
 
-  if (dest == myself && !sendSIGCONT)
-    dest = myself_nowait_nonmain;
   if (sig == 0)
     res = proc_exists (dest) ? 0 : -1;
-  else if ((res = sig_send (dest, sig)))
+  else
     {
-      wm_printf ("%d = sig_send, %E ", res);
-      res = -1;
+      if (dest == myself && !sendSIGCONT)
+	dest = myself_nowait_nonmain;
+      if ((res = sig_send (dest, sig)))
+	{
+	  wm_printf ("%d = sig_send, %E ", res);
+	  res = -1;
+	}
+      else if (sendSIGCONT)
+	(void) sig_send (dest, SIGCONT);
     }
-  else if (sendSIGCONT)
-    (void) sig_send (dest, SIGCONT);
 
   syscall_printf ("%d = kill_worker (%d, %d)", res, pid, sig);
   return res;

____
  | AIST      Kazuhiro Fujieda <fujieda@jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology