Print this page
4823 don't open-code NSEC2MSEC and MSEC2NSEC

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libinetutil/common/tq.c
          +++ new/usr/src/lib/libinetutil/common/tq.c
↓ open down ↓ 87 lines elided ↑ open up ↑
  88   88  
  89   89          /*
  90   90           * find the node to insert this new node "after".  we do this
  91   91           * instead of the more intuitive "insert before" because with
  92   92           * the insert before approach, a null `before' node pointer
  93   93           * is overloaded in meaning (it could be null because there
  94   94           * are no items in the list, or it could be null because this
  95   95           * is the last item on the list, which are very different cases).
  96   96           */
  97   97  
  98      -        node->iutn_abs_timeout = gethrtime() + (msec * (NANOSEC / MILLISEC));
       98 +        node->iutn_abs_timeout = gethrtime() + MSEC2NSEC(msec);
  99   99  
 100  100          if (tq->iutq_head != NULL &&
 101  101              tq->iutq_head->iutn_abs_timeout < node->iutn_abs_timeout)
 102  102                  for (after = tq->iutq_head; after->iutn_next != NULL;
 103  103                      after = after->iutn_next)
 104  104                          if (after->iutn_next->iutn_abs_timeout >
 105  105                              node->iutn_abs_timeout)
 106  106                                  break;
 107  107  
 108  108          node->iutn_next = after ? after->iutn_next : tq->iutq_head;
↓ open down ↓ 334 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX