Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /src/pserver.cc [a906d8] .. [76b03d] Maximize Restore

  Switch to side-by-side view

--- a/src/pserver.cc
+++ b/src/pserver.cc
@@ -28,6 +28,8 @@
 #include <toplev.h>
 
 #include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 #include <iostream>
 #include <sys/stat.h>
 #include <sys/poll.h>
@@ -369,6 +371,9 @@
             }
           else if (pid == 0) 
             {
+              if (fork ())
+                clean_up_and_exit (0);
+
               close (sock);
               signal (SIGCHLD, SIG_DFL);
               signal (SIGTERM, SIG_DFL);
@@ -578,6 +583,8 @@
 
           // parent
 
+          waitpid (pid, NULL, 0);
+
           octave_child_list::insert (pid, pserver_child_event_handler);
 
           RESTORE_SIGNALS (oset);