changeset 22730:838d52a3283e stable

Stop segfault when popen2 called with invalid command (bug #49525). * octave-popen2.c: Call _exit, rather than exit, when there is an error in the child process.
author Mike Miller <mtmiller@octave.org>
date Mon, 07 Nov 2016 07:51:43 -0800
parents 125391edc71b
children 2d74b4653e5d
files liboctave/wrappers/octave-popen2.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/wrappers/octave-popen2.c	Sun Nov 06 16:15:32 2016 -0800
+++ b/liboctave/wrappers/octave-popen2.c	Mon Nov 07 07:51:43 2016 -0800
@@ -206,7 +206,7 @@
       else
         perror ("popen2 (child)");
 
-      exit (0);
+      _exit (127);
     }
   else if (pid > 0)
     {