public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Robert Collins" <robert.collins@itdomain.com.au>
To: <cygwin@cygwin.com>
Subject: Re: bash/cmd CTRL-C problem...
Date: Wed, 09 Jan 2002 23:59:00 -0000	[thread overview]
Message-ID: <010701c199ac$ca415b30$0200a8c0@lifelesswks> (raw)
In-Reply-To: <20020110024653.GA31361@redhat.com>


===
----- Original Message -----
From: "Christopher Faylor" <cgf@redhat.com>
To: <cygwin@cygwin.com>
Sent: Thursday, January 10, 2002 1:46 PM
Subject: Re: bash/cmd CTRL-C problem...


> On Wed, Jan 09, 2002 at 12:16:04PM +1100, Robert Collins wrote:
> >----- Original Message -----
> >From: "Christopher Faylor" <cgf@redhat.com>
> >>I'm specifically trying not to do the "TRUE" thing, though, since
> >>AFAICT it isn't always appropriate.
> >
> >If you want to SIG_IGN the signal, then it is: "When a CTRL+C signal
is
> >received, the control handler returns TRUE, indicating that it has
> >handled the signal.  Doing this prevents other control handlers from
> >being called." (note that this is within this process only).
>
> I was going back over this thread before checking in a change to see
if
> I'd missed something.
>
> I just realized that I didn't address this concern.  Don't know if it
> matters but...
>
> The difference between the SIG_IGN way and the "return TRUE" way is
> that the SIG_IGN way stops the current process from responding to
> a cygwin signal but still lets it respond to a Windows "signal".  That
> means that the code in ctrl_c_handle can do its job, if it has to.

Huh? I actually did the reverse - returning TRUE only prevented
responding to a windows signal, but allowed responding to a cygwin
signal. This meant that 'kill -2 stubpid' from another shell would kill
the stub and it's spawned programs, which may alleviate some of the
'CTRL-C doesn't work for me now' grief that you rightly expect. I
mention this because IMO the strange behaviour is due to user
expectation of ^C behaviour - not signal behaviour.

> If we always "return TRUE" in the exec case, then there will be some
> situations where the SIGINT is not delivered to the rest of the
process
> group since the code in ctrl_c_handler would be short circuited.

I don't believe that is the case: Every console process attached to that
console independently recieves the windows signal. Only one has been
disabled. So the execing process's children will still recieve the
windows signals and the cygwin signals.

> My SIG_IGN "solution" is wrong, too, though.  The SIG_IGN would be
> inherited by the exec'ed process.  Then the execed process would never
> see a cygwin SIGINT signal.

Yes. I still believe that return TRUE is a good solution... but if
you've solved the obvious behaviour I'll be quite now :}.

> Btw, if I fix this, I may well fix a problem with CTRL-C and fork()
that
> I've been noticing for years, too.  Or, at least I'll be able to
convince
> myself its fixed until the next time I see the problem.

Cool.

Rob


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  parent reply	other threads:[~2002-01-10  7:59 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-19 23:48 Michael Rumpf
2001-12-20  1:28 ` Michael Rumpf
2001-12-21  2:17   ` Michael Rumpf
2001-12-21  7:27     ` Corinna Vinschen
2001-12-21  8:46       ` Michael Rumpf
2002-01-04  3:51     ` Michael Rumpf
2002-01-04  9:04       ` Christopher Faylor
2002-01-07  0:46         ` Michael Rumpf
2002-01-07  1:10           ` Robert Collins
2002-01-07  1:58             ` Michael Rumpf
2002-01-07  2:30               ` Robert Collins
2002-01-07  2:56                 ` Michael Rumpf
2002-01-07  5:15                   ` CGF: please review my logic " Robert Collins
2002-01-07  6:18                     ` Michael Rumpf
2002-01-07  8:50                     ` CGF: " Christopher Faylor
2002-01-07 15:00                       ` Robert Collins
2002-01-07 15:45                         ` Christopher Faylor
2002-01-07 16:15                           ` Robert Collins
2002-01-07 16:21                             ` Christopher Faylor
2002-01-07 16:43                               ` Robert Collins
2002-01-07 23:00                                 ` Robert Collins
2002-01-08  8:19                                   ` Christopher Faylor
2002-01-08 14:16                                     ` Robert Collins
2002-01-08 16:39                                       ` Christopher Faylor
2002-01-08 16:43                                         ` Robert Collins
2002-01-08 16:55                                           ` Christopher Faylor
2002-01-08 16:57                                             ` Robert Collins
2002-01-08 17:13                                               ` Christopher Faylor
2002-01-08 17:16                                                 ` Robert Collins
2002-01-09 18:46                                                   ` Christopher Faylor
2002-01-09 19:42                                                     ` Christopher Faylor
2002-01-09 23:59                                                     ` Robert Collins [this message]
2002-01-10  7:53                                                       ` Christopher Faylor
2002-01-08 17:46                                                 ` Charles Wilson
     [not found]                                   ` <027401c19855$68842f60$c51811ac@brokat.de>
     [not found]                                     ` <03a901c1989b$69c8e190$0200a8c0@lifelesswks>
2002-01-09  0:14                                       ` Michael Rumpf
2002-01-07  8:09 Gregory W. Bond
2002-01-07  8:27 ` Michael Rumpf
2002-01-07  9:06   ` Gregory W. Bond
2002-01-07  9:18     ` Michael Rumpf
2002-01-07  9:32     ` Christopher Faylor
2002-01-07  9:28 Gregory W. Bond
2002-01-07 10:07 ` Christopher Faylor
2002-01-07 12:14   ` Gregory W. Bond
     [not found] <3C3E059B.2080401@ece.gatech.edu>
2002-01-11  4:01 ` Andy Piper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='010701c199ac$ca415b30$0200a8c0@lifelesswks' \
    --to=robert.collins@itdomain.com.au \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).