changeset 17801:0b81d65d3c49

only fork and exec when starting gui * main.in.cc (main): Reverse sense of test. Switch test to check gui_libs instead of cli_only.
author John W. Eaton <jwe@octave.org>
date Wed, 30 Oct 2013 00:18:28 -0400
parents 56d09eba7c3b
children f461e4a47680
files src/main.in.cc
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.in.cc	Tue Oct 29 20:39:15 2013 -0700
+++ b/src/main.in.cc	Wed Oct 30 00:18:28 2013 -0400
@@ -398,7 +398,7 @@
 
 #if defined (HAVE_OCTAVE_GUI)
   bool start_gui = true;
-  bool cli_only = false;
+  bool gui_libs = true;
 #endif
 
   std::string octave_bindir = get_octave_bindir ();
@@ -427,7 +427,7 @@
           // on as that option is not recognized by Octave.
 
 #if defined (HAVE_OCTAVE_GUI)
-          cli_only = true;
+          gui_libs = false;
 #endif
           file = octave_bindir + dir_sep_char + "octave-cli";
         }
@@ -456,11 +456,7 @@
 
 #else
 
-  if (cli_only || (! start_gui && ! have_controlling_terminal ()))
-    {
-      retval = octave_exec (file, new_argv);
-    }
-  else
+  if (gui_libs && start_gui && have_controlling_terminal ())
     {
       install_signal_handlers ();
 
@@ -505,6 +501,8 @@
             }
         }
     }
+  else
+    retval = octave_exec (file, new_argv);
 
 #endif