aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-pipe.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-05-25 16:00:09 +0000
committerDoug Evans <dje@google.com>2010-05-25 16:00:09 +0000
commite34838f0f74e1fdb249bcdd822136c98375e4f4b (patch)
tree34b21f0b52d6a6db008b7c1684a9485e37d302de /gdb/ser-pipe.c
parent01f69b386b461447a7135401002856d67103418d (diff)
downloadgdb-e34838f0f74e1fdb249bcdd822136c98375e4f4b.zip
gdb-e34838f0f74e1fdb249bcdd822136c98375e4f4b.tar.gz
gdb-e34838f0f74e1fdb249bcdd822136c98375e4f4b.tar.bz2
* ser-pipe.c (pipe_open): Ignore SIGINTs in child.
Diffstat (limited to 'gdb/ser-pipe.c')
-rw-r--r--gdb/ser-pipe.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index 92ad3d9..07fe65b 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -99,6 +99,15 @@ pipe_open (struct serial *scb, const char *name)
/* Child. */
if (pid == 0)
{
+ /* We don't want ^c to kill the connection. */
+#ifdef HAVE_SETSID
+ pid_t sid = setsid ();
+ if (sid == -1)
+ signal (SIGINT, SIG_IGN);
+#else
+ signal (SIGINT, SIG_IGN);
+#endif
+
/* re-wire pdes[1] to stdin/stdout */
close (pdes[0]);
if (pdes[1] != STDOUT_FILENO)