Print this page
arcstat

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/stat/common/common.c
          +++ new/usr/src/cmd/stat/common/common.c
↓ open down ↓ 94 lines elided ↑ open up ↑
  95   95          if (pause < 1000)
  96   96                  /* Near enough */
  97   97                  return;
  98   98  
  99   99          /* Now do the actual sleep */
 100  100          pause_left = pause;
 101  101          do {
 102  102                  pause_tv.tv_sec = pause_left / NANOSEC;
 103  103                  pause_tv.tv_nsec = pause_left % NANOSEC;
 104  104                  status = nanosleep(&pause_tv, (struct timespec *)NULL);
 105      -                if (status < 0)
      105 +                if (status < 0) {
 106  106                          if (errno == EINTR) {
 107  107                                  now = gethrtime();
 108  108                                  pause_left = *wakeup - now;
 109  109                                  if (pause_left < 1000)
 110  110                                          /* Near enough */
 111  111                                          return;
 112  112                          } else {
 113  113                                  fail(1, "nanosleep failed");
 114  114                          }
      115 +                }
 115  116          } while (status != 0);
 116  117  }
 117  118  
 118  119  /*
 119  120   * Signal handler - so we can be aware of SIGCONT
 120  121   */
 121  122  void
 122  123  cont_handler(int sig_number)
 123  124  {
 124  125          /* Re-set the signal handler */
 125  126          (void) signal(sig_number, cont_handler);
 126  127          caught_cont = 1;
 127  128  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX