delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/03/02/21:10:57

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT bbc DOT com>
Date: Tue, 2 Mar 1999 20:46:04 -0500
To: Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
Cc: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: kill(getpid(), 0) will fail
Message-ID: <19990302204604.B2772@cygnus.com>
References: <ud82zvz47 DOT fsf AT parvati DOT will DOT or DOT jp>
Mime-Version: 1.0
X-Mailer: Mutt 0.95.3i
In-Reply-To: <ud82zvz47.fsf@parvati.will.or.jp>; from Kazuhiro Fujieda on Thu, Feb 25, 1999 at 02:19:52PM +0900

I think the correct patch is to make proc_exists recognize the
various flavors of "myself" as pointers to the current process.
I've checked in a patch to do that.  That should eliminate your
problem also, shouldn't it?

cgf

On Thu, Feb 25, 1999 at 02:19:52PM +0900, Kazuhiro Fujieda wrote:
>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;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019