diff liboctave/oct-syscalls.cc @ 5453:89f5979e8552

[project @ 2005-09-17 00:50:58 by jwe]
author jwe
date Sat, 17 Sep 2005 00:50:58 +0000
parents 4c8a2e4e0717
children ced23ae2b5cc
line wrap: on
line diff
--- a/liboctave/oct-syscalls.cc	Fri Sep 16 15:11:25 2005 +0000
+++ b/liboctave/oct-syscalls.cc	Sat Sep 17 00:50:58 2005 +0000
@@ -46,9 +46,9 @@
 
 #include <signal.h>
 
+#include "lo-utils.h"
 #include "oct-syscalls.h"
 #include "str-vec.h"
-#include "syswait.h"
 
 #define NOT_SUPPORTED(nm) \
   nm ": not supported on this system"
@@ -299,23 +299,22 @@
 }
 
 pid_t
-octave_syscalls::waitpid (pid_t pid, int options)
+octave_syscalls::waitpid (pid_t pid, int *status, int options)
 {
   std::string msg;
-  return waitpid (pid, options, msg);
+  return waitpid (pid, status, options, msg);
 }
 
 pid_t
-octave_syscalls::waitpid (pid_t pid, int options, std::string& msg)
+octave_syscalls::waitpid (pid_t pid, int *status, int options,
+			  std::string& msg)
 {
   msg = std::string ();
 
-  int status = -1;
+#if defined (HAVE_WAITPID)
+  pid_t retval = ::octave_waitpid (pid, status, options);
 
-#if defined (HAVE_WAITPID)
-  status = ::waitpid (pid, 0, options);
-
-  if (status < 0)
+  if (retval < 0)
     {
       using namespace std;
       msg = ::strerror (errno);
@@ -324,7 +323,7 @@
   msg = NOT_SUPPORTED ("waitpid");
 #endif
 
-  return status;
+  return retval;
 }
 
 int