httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@ast.cam.ac.uk (David Robinson)
Subject Re: 82 replacement?
Date Tue, 13 Feb 1996 16:48:00 GMT
>Any problems with this?  .........
>
>82b.setsockopt_next.patch
>
>From: Rob H   (original by  Martijn Koster <mak@beach.webcrawler.com>)
>Subject: damn NeXT's gotta be different.
>         setsockopt doesn't take a const declared argument for NeXT
>Changelog: setsockopt no longer takes a const declared argument when
>        compiling under NeXT.
>Affects: http_main.c conf.h

>*** conf.h.orig Mon Feb 12 15:13:16 1996
>--- conf.h      Mon Feb 12 15:14:25 1996
>***************
>*** 55,60 ****
>--- 55,62 ----
>  /*
>   * conf.h: system-dependant #defines and includes...
>   */
>+  
>+ #define SETSOCKOPT_CONST const
>  
>  #ifndef QNX
>  #include <sys/param.h>
>***************
>*** 135,140 ****
>--- 137,143 ----
>  #define tolower(c) (isupper(c) ? tolower(c) : c)
>  
>  #elif defined(NEXT)
>+ #define SETSOCKOPT_CONST 
>  #include <libc.h>
>  typedef unsigned short mode_t;
>  #define HAS_GMTOFF
>*** http_main.c.orig    Mon Feb 12 15:10:51 1996
>--- http_main.c Mon Feb 12 15:15:05 1996
>***************
>*** 996 ****
>!     if((setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(const char *)&one,sizeof(one)))---
996 ----
>!     if((setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(SETSOCKOPT_CONST char *)&one,sizeof(one)))
>***************
>*** 1002 ****
>!     if((setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(const char *)&keepalive_value,
>--- 1002 ----
>!     if((setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(SETSOCKOPT_CONST char *)&keepalive_value,
>
I don't have any problems with this, but for any architecture where
SETSOCKOPT_CONST should be const, setting it to "" would be fine; passing
a char * to a routine which takes const char * is always acceptable.

So I suggest that you get rid of SOCKSETOPT_CONST, and simply remove
the const from any setsockopt calls.

(I've just made that change to mod_proxy.c, in addition to fixing the
other compilation warnings you mentioned.)

 David.

Mime
View raw message