You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@hyperreal.org on 1999/02/16 07:07:11 UTC

cvs commit: apache-apr/pthreads/src/main http_config.c http_main.c

manoj       99/02/15 22:07:10

  Modified:    pthreads/src/main http_config.c http_main.c
  Log:
  The code used to assume that a 0 fd is an error, which is not the case.
  Now, -1 is used as the error state instead (as in apache-1.3).
  
  Revision  Changes    Path
  1.8       +1 -1      apache-apr/pthreads/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_config.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -u -r1.7 -r1.8
  --- http_config.c	1999/02/11 16:33:04	1.7
  +++ http_config.c	1999/02/16 06:07:09	1.8
  @@ -1449,7 +1449,7 @@
       new->local_addr.sin_family = AF_INET;
       new->local_addr.sin_addr = ap_bind_address;
       new->local_addr.sin_port = htons(s->port ? s->port : DEFAULT_HTTP_PORT);
  -    new->fd = NULL;
  +    new->fd = -1;
       new->index = 0;
       new->next = NULL;
       ap_listeners = new;
  
  
  
  1.27      +3 -3      apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -u -r1.26 -r1.27
  --- http_main.c	1999/02/15 21:04:21	1.26
  +++ http_main.c	1999/02/16 06:07:09	1.27
  @@ -1447,7 +1447,7 @@
   	    return or->fd;
   	}
       }
  -    return 0;
  +    return -1;
   }
   
   
  @@ -1476,13 +1476,13 @@
       num_listenfds = 0;
       for (;;) {
   	fd = find_listener(lr);
  -	if (fd == 0) {
  +	if (fd < 0) {
   	    fd = make_sock(p, &lr->local_addr);
   	}
   	else {
   	    ap_note_cleanups_for_fd(p, fd);
   	}
  -	if (fd) {
  +	if (fd >= 0) {
               ++num_listenfds;
   	}
   	lr->fd = fd;