diff src/octave.cc @ 1022:d3790919922e

[project @ 1995-01-11 00:45:09 by jwe]
author jwe
date Wed, 11 Jan 1995 00:46:50 +0000
parents dfe01093f657
children a6f341c1b47c
line wrap: on
line diff
--- a/src/octave.cc	Tue Jan 10 23:20:48 1995 +0000
+++ b/src/octave.cc	Wed Jan 11 00:46:50 1995 +0000
@@ -942,6 +942,15 @@
 
       int status = cmd.close ();
 
+// The value in status is as returned by waitpid.  If the process
+// exited normally, extract the actual exit status of the command.
+// Otherwise, return 127 as a failure code.
+
+      if ((status & 0xff) == 0)
+	status = (status & 0xff00) >> 8;
+      else
+	status = 127;
+
       if (nargout > 0 || nargin > 1)
 	{
 	  char *msg = output_buf.str ();