public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] ser-pipe.c (pipe_open): Ignore SIGINTs in child.
@ 2010-04-27  3:52 Doug Evans
  2010-04-27 17:44 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Evans @ 2010-04-27  3:52 UTC (permalink / raw)
  To: gdb-patches

I was debugging "tar rem | ..." today and found that typing ^c
killed the child of the pipe.

I will check this in in a few days if there are no objections.

2010-04-26  Doug Evans  <dje@google.com>

	* ser-pipe.c (pipe_open): Ignore SIGINTs in child.

Index: ser-pipe.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-pipe.c,v
retrieving revision 1.24
diff -u -p -r1.24 ser-pipe.c
--- ser-pipe.c	20 Apr 2010 05:52:07 -0000	1.24
+++ ser-pipe.c	27 Apr 2010 03:49:05 -0000
@@ -98,6 +98,8 @@ pipe_open (struct serial *scb, const cha
   /* Child. */
   if (pid == 0)
     {
+      signal (SIGINT, SIG_IGN);
+
       /* re-wire pdes[1] to stdin/stdout */
       close (pdes[0]);
       if (pdes[1] != STDOUT_FILENO)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] ser-pipe.c (pipe_open): Ignore SIGINTs in child.
  2010-04-27  3:52 [patch] ser-pipe.c (pipe_open): Ignore SIGINTs in child Doug Evans
@ 2010-04-27 17:44 ` Tom Tromey
  2010-04-27 17:57   ` Doug Evans
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2010-04-27 17:44 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> I was debugging "tar rem | ..." today and found that typing ^c
Doug> killed the child of the pipe.

I think it is preferable to call setsid, so that the child is dissociated
from the controlling terminal.  That way C-c won't send it a SIGINT.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] ser-pipe.c (pipe_open): Ignore SIGINTs in child.
  2010-04-27 17:44 ` Tom Tromey
@ 2010-04-27 17:57   ` Doug Evans
  2010-04-27 20:27     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Evans @ 2010-04-27 17:57 UTC (permalink / raw)
  To: tromey; +Cc: gdb-patches

On Tue, Apr 27, 2010 at 10:43 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> I was debugging "tar rem | ..." today and found that typing ^c
> Doug> killed the child of the pipe.
>
> I think it is preferable to call setsid, so that the child is dissociated
> from the controlling terminal.  That way C-c won't send it a SIGINT.

#ifdef HAVE_SETSID

sounds good.

[create_tty_session doesn't have any code to handle, e.g., win32, so
punt to SIG_IGN #ifndef HAVE_SETSID?]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] ser-pipe.c (pipe_open): Ignore SIGINTs in child.
  2010-04-27 17:57   ` Doug Evans
@ 2010-04-27 20:27     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2010-04-27 20:27 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> [create_tty_session doesn't have any code to handle, e.g., win32, so
Doug> punt to SIG_IGN #ifndef HAVE_SETSID?]

I don't know what to do in that case.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-27 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-27  3:52 [patch] ser-pipe.c (pipe_open): Ignore SIGINTs in child Doug Evans
2010-04-27 17:44 ` Tom Tromey
2010-04-27 17:57   ` Doug Evans
2010-04-27 20:27     ` Tom Tromey

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).