Changeset 3211 for trunk/Ohana/src/opihi/pclient/ChildOps.c
- Timestamp:
- Feb 13, 2005, 6:49:20 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pclient/ChildOps.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pclient/ChildOps.c
r3187 r3211 1 1 # include "pclient.h" 2 3 static int Nbad = 0; 4 static struct timeval last = {0, 0}; 2 5 3 6 int InitChild () { … … 22 25 23 26 int Nread; 27 pid_t ppid; 28 double dtime; 29 struct timeval now; 30 31 /* this is really lame : check if we are calling too quickly */ 32 gettimeofday (&now, NULL); 33 dtime = DTIME (now, last); 34 last = now; 35 if (dtime < 0.0001) Nbad ++; 36 if (dtime > 0.01) Nbad = 0; 37 if (Nbad > 10) { 38 fprintf (stderr, "parent shutdown\n"); 39 exit (2); 40 } 41 42 /* this is a bit lame : we must exit if calling process exits */ 43 ppid = getppid(); 44 if (ppid == 1) { 45 fprintf (stderr, "parent shutdown\n"); 46 exit (2); 47 } 24 48 25 49 CheckChildStatus ();
Note:
See TracChangeset
for help on using the changeset viewer.
