comparison 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
comparison
equal deleted inserted replaced
1021:4ebc7911ab98 1022:d3790919922e
940 940
941 output_buf << ends; 941 output_buf << ends;
942 942
943 int status = cmd.close (); 943 int status = cmd.close ();
944 944
945 // The value in status is as returned by waitpid. If the process
946 // exited normally, extract the actual exit status of the command.
947 // Otherwise, return 127 as a failure code.
948
949 if ((status & 0xff) == 0)
950 status = (status & 0xff00) >> 8;
951 else
952 status = 127;
953
945 if (nargout > 0 || nargin > 1) 954 if (nargout > 0 || nargin > 1)
946 { 955 {
947 char *msg = output_buf.str (); 956 char *msg = output_buf.str ();
948 957
949 retval(1) = (double) status; 958 retval(1) = (double) status;