* ser-pipe.c (pipe_open): Ignore SIGINTs in child.
This commit is contained in:
parent
01f69b386b
commit
e34838f0f7
2 changed files with 11 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
2010-05-25 Doug Evans <dje@google.com>
|
2010-05-25 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
* ser-pipe.c (pipe_open): Ignore SIGINTs in child.
|
||||||
|
|
||||||
* event-loop.h (GDB_READABLE, GDB_WRITABLE, GDB_EXCEPTION): Move to ...
|
* event-loop.h (GDB_READABLE, GDB_WRITABLE, GDB_EXCEPTION): Move to ...
|
||||||
* event-loop.c: ... here.
|
* event-loop.c: ... here.
|
||||||
* tui/tui-io.c (tui_readline_output): Rename parameter `code' to
|
* tui/tui-io.c (tui_readline_output): Rename parameter `code' to
|
||||||
|
|
|
@ -99,6 +99,15 @@ pipe_open (struct serial *scb, const char *name)
|
||||||
/* Child. */
|
/* Child. */
|
||||||
if (pid == 0)
|
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 */
|
/* re-wire pdes[1] to stdin/stdout */
|
||||||
close (pdes[0]);
|
close (pdes[0]);
|
||||||
if (pdes[1] != STDOUT_FILENO)
|
if (pdes[1] != STDOUT_FILENO)
|
||||||
|
|
Loading…
Add table
Reference in a new issue