IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2005, 6:49:20 PM (21 years ago)
Author:
eugene
Message:

pcontrol dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pclient/ChildOps.c

    r3187 r3211  
    11# include "pclient.h"
     2
     3static int Nbad = 0;
     4static struct timeval last = {0, 0};
    25
    36int InitChild () {
     
    2225
    2326  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  } 
    2448
    2549  CheckChildStatus ();
Note: See TracChangeset for help on using the changeset viewer.