httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/os2 poll.c
Date Mon, 13 Nov 2000 04:27:51 GMT
bjh         00/11/12 20:27:51

  Modified:    src/lib/apr/network_io/os2 poll.c
  Log:
  Rework apr_poll to use APR time types, fixing bug where an indefinite
  timeout (-1) was becoming 0 due to the divide by APR_USEC_PER_SEC.
  
  Revision  Changes    Path
  1.18      +3 -10     apache-2.0/src/lib/apr/network_io/os2/poll.c
  
  Index: poll.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/poll.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- poll.c	2000/08/06 06:07:21	1.17
  +++ poll.c	2000/11/13 04:27:50	1.18
  @@ -131,15 +131,8 @@
   {
       int i;
       int rv = 0;
  -    time_t starttime;
  -    struct timeval tv;
  +    apr_time_t starttime = apr_now();
   
  -    timeout /= APR_USEC_PER_SEC; /* TODO: rework for microseconds and axe this */
  -
  -    tv.tv_sec = timeout;
  -    tv.tv_usec = 0;
  -    time(&starttime);
  -
       do {
           for (i=0; i<pollfdset->num_total; i++) {
               pollfdset->r_socket_list[i] = pollfdset->socket_list[i];
  @@ -149,10 +142,10 @@
                       pollfdset->num_read, 
                       pollfdset->num_write, 
                       pollfdset->num_except, 
  -                    timeout >= 0 ? timeout * 1000 : -1);
  +                    timeout >= 0 ? timeout / 1000 : -1);
   
           if (rv < 0 && sock_errno() == SOCEINTR && timeout >= 0 )
{
  -            time_t elapsed = time(NULL) - starttime;
  +            apr_interval_time_t elapsed = apr_now() - starttime;
   
               if (timeout <= elapsed)
                   break;
  
  
  

Mime
View raw message