From 269fc0560920a2a6b1cbd35034bf6d1aa6794a6f Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 1 Oct 2002 18:57:52 +0000 Subject: [PATCH] Check for the right thing. git-svn-id: https://svn.dealii.org/trunk@6584 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/contrib/hsl/source/detached_ma27.cc | 5 +++-- deal.II/lac/source/sparse_direct.cc | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deal.II/contrib/hsl/source/detached_ma27.cc b/deal.II/contrib/hsl/source/detached_ma27.cc index 77e517f411..2d13382083 100644 --- a/deal.II/contrib/hsl/source/detached_ma27.cc +++ b/deal.II/contrib/hsl/source/detached_ma27.cc @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef HAVE_STD_STRINGSTREAM # include @@ -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 diff --git a/deal.II/lac/source/sparse_direct.cc b/deal.II/lac/source/sparse_direct.cc index 551e1df71e..938fa204d7 100644 --- a/deal.II/lac/source/sparse_direct.cc +++ b/deal.II/lac/source/sparse_direct.cc @@ -29,6 +29,8 @@ #endif #include +#include +#include #include #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 -- 2.39.5