# HG changeset patch # User John W. Eaton # Date 1368514147 14400 # Node ID c1d5bf2eb3b6448e70b4c26b82f33cc5be7f13ee # Parent cf84ea2ba2d37bdfa21a99f3bf6e5f8f768b90c2 go back to fork and setsid, but not on OS X systems * octave-gui.cc (dissociate_terminal): Use fork and setsid. diff -r cf84ea2ba2d3 -r c1d5bf2eb3b6 libgui/src/octave-gui.cc --- a/libgui/src/octave-gui.cc Mon May 13 18:50:14 2013 -0400 +++ b/libgui/src/octave-gui.cc Tue May 14 02:49:07 2013 -0400 @@ -29,6 +29,7 @@ #include +#include #include #if defined (HAVE_SYS_IOCTL_H) @@ -49,12 +50,7 @@ static void dissociate_terminal (void) { -#if ! defined (__WIN32__) || defined (__CYGWIN__) -# if defined (HAVE_SYS_IOCTL_H) && defined (TIOCNOTTY) - - ioctl (0, TIOCNOTTY); - -# else +#if ! (defined (__WIN32__) || defined (__APPLE__)) || defined (__CYGWIN__) pid_t pid = fork (); @@ -77,6 +73,9 @@ { // Parent + // FIXME -- we should catch signals and pass them on to the child + // process in some way, possibly translating SIGINT to SIGTERM. + int status; waitpid (pid, &status, 0); @@ -85,7 +84,6 @@ ? octave_wait::exitstatus (status) : 127); } -# endif #endif }