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
- To: cygwin-developers@sourceware.cygnus.com
- Subject: kill(getpid(), 0) will fail
- From: Kazuhiro Fujieda <fujieda@jaist.ac.jp>
- Date: 25 Feb 1999 14:19:52 +0900
- Delivered-To: listarch-cygwin-developers@sourceware.cygnus.com
- Delivered-To: mailing list cygwin-developers@sourceware.cygnus.com
- Mailing-List: contact cygwin-developers-help@sourceware.cygnus.com; run by ezmlm
- Sender: cygwin-developers-owner@sourceware.cygnus.com
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