IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2020, 1:54:47 PM (6 years ago)
Author:
tdeboer
Message:

revert to working Ohana build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.data/open_kapa.c

    r41162 r41340  
    266266int close_kapa (char *name) {
    267267
    268   struct timespec request, remain;
    269268  int N;
    270269
     
    275274  }
    276275  DelKapaDevice (name);
    277 
    278   // avoid blocking on waitpid, test every 1 msec, up to 500 msec
    279   request.tv_sec = 0;
    280   request.tv_nsec = 1000000;
    281 
    282   // try to harvest the child PID
    283   int waitstatus = 0;
    284   int result = waitpid (-1, &waitstatus, WNOHANG);
    285   for (int i = 0; (i < 500) && (result == 0); i++) {
    286     nanosleep (&request, &remain);
    287     result = waitpid (-1, &waitstatus, WNOHANG);
    288   }
    289 
    290   if ((result == -1) && (errno != ECHILD)) {
    291     fprintf (stderr, "unexpected error from waitpid (%d): programming error\n", errno);
    292   }
    293   if (result == 0) {
    294     fprintf (stderr, "child did not exit (close_kapa), timeout");
    295   }
    296 
    297276  return (TRUE);
    298277}
Note: See TracChangeset for help on using the changeset viewer.