Browse Source

SITL: setsid() when starting JSBSim so Ctrl-C doesn't kill it in GDB

mission-4.1.18
Peter Barker 9 years ago committed by Andrew Tridgell
parent
commit
7510e4d0a7
  1. 1
      libraries/SITL/SIM_JSBSim.cpp

1
libraries/SITL/SIM_JSBSim.cpp

@ -182,6 +182,7 @@ bool JSBSim::start_JSBSim(void) @@ -182,6 +182,7 @@ bool JSBSim::start_JSBSim(void)
pid_t child_pid = fork();
if (child_pid == 0) {
// in child
setsid();
dup2(devnull, 0);
dup2(p[1], 1);
close(p[0]);

Loading…
Cancel
Save