]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check for the right thing.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Oct 2002 18:57:52 +0000 (18:57 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Oct 2002 18:57:52 +0000 (18:57 +0000)
git-svn-id: https://svn.dealii.org/trunk@6584 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/hsl/source/detached_ma27.cc
deal.II/lac/source/sparse_direct.cc

index 77e517f4110517b4d47307a21c0b2d8d856ac7f5..2d13382083c3c47282e5aa279a71f01c5c0dc5f5 100644 (file)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <pthread.h>
 #include <signal.h>
+#include <sys/types.h>
 
 #ifdef HAVE_STD_STRINGSTREAM
 #  include <sstream>
@@ -149,10 +150,10 @@ void monitor_parent_liveness (const pid_t master_pid)
 //      int ret = std::system (command);
       int ret = kill (master_pid, 0);
       if (ret != 0)
-        if (ret == ESRCH)
+        if ((ret == -1) && (errno == ESRCH))
           die ("Master process seems to have died!");
         else
-          die ("Unspecified error while checking for other process!");
+          die ("Unspecified error while checking for other process!", ret, errno);
 
                                        // ok, master still running,
                                        // take a little rest and then
index 551e1df71eb64376f2e26af3dd3f90358cc42502..938fa204d72eded99f53dd18d5a8186c7cca46d6 100644 (file)
@@ -29,6 +29,8 @@
 #endif
 
 #include <sys/wait.h>
+#include <sys/types.h>
+#include <signal.h>
 #include <unistd.h>
 
 #ifndef DEAL_II_USE_DIRECT_ERRNO_H
@@ -331,10 +333,10 @@ void monitor_child_liveness (const pid_t child_pid)
 //           die ("Child process seems to have died!");
       int ret = kill (child_pid, 0);
       if (ret != 0)
-        if (ret == ESRCH)
+        if ((ret == -1) && (errno == ESRCH))
           die ("Child process seems to have died!");
         else
-          die ("Unspecified error while checking for other process!");
+          die ("Unspecified error while checking for other process!", ret, errno);
 
                                        // ok, master still running,
                                        // take a little rest and then

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.