changeset 21343:980abb267014

Emit error if fork called directly from command line. * syscalls.cc (Ffork): call error if trying to fork from interactive command line.
author Rik <rik@octave.org>
date Wed, 24 Feb 2016 21:47:10 -0800
parents 798273bbe551
children 32651c9a1235 12280fef2741
files libinterp/corefcn/syscalls.cc
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/syscalls.cc	Wed Feb 24 23:17:14 2016 -0500
+++ b/libinterp/corefcn/syscalls.cc	Wed Feb 24 21:47:10 2016 -0800
@@ -471,6 +471,9 @@
   if (args.length () != 0)
     print_usage ();
 
+  if (symbol_table::at_top_level ())
+    error ("fork: cannot be called from command line"); 
+
   std::string msg;
 
   pid_t pid = octave_syscalls::fork (msg);