httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Wilson <and...@tees.elsevier.co.uk>
Subject Ident warnings under FreeBSD
Date Wed, 22 Nov 1995 12:23:14 GMT
>  0      44_ident.0.8.16.patch
> 
>         Wups.  Can someone improve this?
> 
>         compiler warning:
> 
>         gcc -c -O2 -DXBITHACK -m486 http_main.c
>         http_main.c: In function `child_main':
>         http_main.c:786: warning: passing arg 2 of `getsockname' from incompatible pointer
type
> 
>         Note: from 'man getsockname' on FreeBSD we get:
> 
>         SYNOPSIS
>              int
>              getsockname(int s, struct sockaddr *name, int *namelen)
> 
>         I mean, it seems to work (had to install inetd to test it even),
>         but I think we just got lucky.
> 
> The warning is harmless, but this patch (to be applied after 44_ident)
> should fix it.

Oh, the line number is bogus, sorry, sorry.  I had god knows how many
other patches in line at the time.  The point was that the call to
getsockname() had the wrong type defined for the *name parameter; this
weird type arising from the #if defined(NEXT)... lines.  But like you
say it seems to work all the same.

I can't test this new fix right now, I'll ask Paul R to lend a hand
this afternoon.

>  David.
> 
> *** http_main.c.orig2	Mon Nov  6 18:20:18 1995
> --- http_main.c	Wed Nov 22 11:15:13 1995
> ***************
> *** 718,729 ****
>   void child_main(int child_num_arg)
>   {
>       int clen;
> - #if defined(NEXT) || defined(LINUX) || defined(SOLARIS2)
>       struct sockaddr sa_server;
>       struct sockaddr sa_client;
> - #else
> -     struct sockaddr_in sa_server,sa_client;
> - #endif
>   
>   #ifdef ULTRIX_BRAIN_DEATH
>       extern char *rfc931();
> --- 718,725 ----
> ***************
> *** 776,782 ****
>   	
>   	accept_mutex_on();  /* Lock around "accept", if necessary */
>   	
> ! 	while ((csd=accept(sd,(struct sockaddr *)&sa_client,&clen)) == -1) 
>              if (errno != EINTR) 
>   		log_error("socket error: accept failed", server_conf);
>   
> --- 772,778 ----
>   	
>   	accept_mutex_on();  /* Lock around "accept", if necessary */
>   	
> ! 	while ((csd=accept(sd, &sa_client, &clen)) == -1) 
>              if (errno != EINTR) 
>   		log_error("socket error: accept failed", server_conf);
>   
> 


Mime
View raw message