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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libldap5/sources/ldap/common/os-ip.c
          +++ new/usr/src/lib/libldap5/sources/ldap/common/os-ip.c
   1    1  /*
   2    2   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
   3    3   * Use is subject to license terms.
   4    4   */
   5    5  
   6      -#pragma ident   "%Z%%M% %I%     %E% SMI"
   7      -
   8    6  /*
   9    7   * The contents of this file are subject to the Netscape Public
  10    8   * License Version 1.1 (the "License"); you may not use this file
  11    9   * except in compliance with the License. You may obtain a copy of
  12   10   * the License at http://www.mozilla.org/NPL/
  13   11   *
  14   12   * Software distributed under the License is distributed on an "AS
  15   13   * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  16   14   * implied. See the License for the specific language governing
  17   15   * rights and limitations under the License.
↓ open down ↓ 292 lines elided ↑ open up ↑
 310  308                          "resetting connect timeout to default value "
 311  309                          "(LDAP_X_IO_TIMEOUT_NO_TIMEOUT\n", 0, 0, 0);
 312  310                  msec = LDAP_X_IO_TIMEOUT_NO_TIMEOUT;
 313  311          } else {
 314  312                  if (msec != 0) {
 315  313                          tval.tv_sec = msec / MILLISEC;
 316  314                          tval.tv_usec = (MICROSEC / MILLISEC) *
 317  315                                              (msec % MILLISEC);
 318  316  #ifdef _SOLARIS_SDK
 319  317                          start_time = gethrtime();
 320      -                        tv_time = (hrtime_t)msec * (NANOSEC / MILLISEC);
      318 +                        tv_time = MSEC2NSEC(msec);
 321  319  #else
 322  320                          start_time = (long)time(NULL);
 323  321  #endif
 324  322                  } else {
 325  323                          tval.tv_sec = 0;
 326  324                          tval.tv_usec = 0;
 327  325                  }
 328  326          }
 329  327  
 330  328          /* if timeval structure == NULL, select will block indefinitely */
↓ open down ↓ 1492 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX