Index: trunk/Ohana/src/opihi/pclient/ChildOps.c
===================================================================
--- trunk/Ohana/src/opihi/pclient/ChildOps.c	(revision 3187)
+++ trunk/Ohana/src/opihi/pclient/ChildOps.c	(revision 3211)
@@ -1,3 +1,6 @@
 # include "pclient.h"
+
+static int Nbad = 0;
+static struct timeval last = {0, 0};
 
 int InitChild () {
@@ -22,4 +25,25 @@
 
   int Nread;
+  pid_t ppid;
+  double dtime;
+  struct timeval now;
+
+  /* this is really lame : check if we are calling too quickly */
+  gettimeofday (&now, NULL);
+  dtime = DTIME (now, last);
+  last = now;
+  if (dtime < 0.0001) Nbad ++;
+  if (dtime > 0.01) Nbad = 0;
+  if (Nbad > 10) {
+    fprintf (stderr, "parent shutdown\n");
+    exit (2);
+  }  
+
+  /* this is a bit lame : we must exit if calling process exits */
+  ppid = getppid();
+  if (ppid == 1) {
+    fprintf (stderr, "parent shutdown\n");
+    exit (2);
+  }  
 
   CheckChildStatus ();
