[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

Re: Solaris and setsockopts

Bryan Stansell bryan@conserver.com
Thu, 3 Jun 2004 12:27:55 -0700 (PDT)


On Thu, Jun 03, 2004 at 10:04:39AM +0200, Trond Hagen wrote:
> [Thu Jun  3 07:00:28 2004] conserver (26279): ERROR: [test]
> setsockopt(8,SO_KEEPALIVE): Invalid argument: forcing down

i bet you've compiled the thing as a 64bit app, right?

that's my guess...and when i tried that on my solaris box, i got the
same error.  for some reason i'm using the wrong variable type on the
setsockopt() call (i think i got "confused" at one point a while
back...).

anyway, the fix is simple...apply this patch to conserver/consent.c:

*** consent.c.orig	Thu Jun  3 12:22:09 2004
--- consent.c	Thu Jun  3 12:22:17 2004
***************
*** 734,740 ****
  	    {
  		struct sockaddr_in port;
  		struct hostent *hp;
! 		size_t one = 1;
  
  		usleep(100000);	/* Not all terminal servers can keep up */
  
--- 734,740 ----
  	    {
  		struct sockaddr_in port;
  		struct hostent *hp;
! 		int one = 1;
  
  		usleep(100000);	/* Not all terminal servers can keep up */

that fixed it for me, at least.  the other calls to setsockopt() in the
rest of the program use the correct type.

Bryan