Skip to Content.
Sympa Menu

freetds - Re: [freetds] Getting it to all work on HPUX

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Michael Warchut" <mike AT warchut.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Getting it to all work on HPUX
  • Date: Fri, 6 Feb 2009 07:38:24 -0800

Thanks.. I have another box to build this weekend so I will give this a try
and see what it yields me.

Michael


-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Frediano Ziglio
Sent: Friday, February 06, 2009 5:53 AM
To: FreeTDS Development Group
Subject: Re: [freetds] Getting it to all work on HPUX

2009/2/4 Michael Warchut <mike AT warchut.com>:
> James
>
> I did what you suggested.. Adding sleep didn't help the situation but
> commenting out the getsockopt check did. I can now connect successfully.
> It's kind of hack so I would love to figure out the root cause and fix it
> but at this point I will take what I can get.. :)
>
>

Please try replacing


len = 0;
if (getsockopt(tds->s, SOL_SOCKET, SO_ERROR, (char *) &len, &optlen)
!= 0) {
tdsdump_log(TDS_DBG_ERROR, "getsockopt(2) failed: %s\n",
strerror(sock_errno));
goto not_available;
}


with


len = 0;
if (getsockopt(tds->s, SOL_SOCKET, SO_ERROR, (char *) &len, &optlen)
!= 0) {
#if defined(__hpux__) && SIZEOF_VOID_P == 8 && SIZEOF_INT == 4
int optlen = sizeof(len);
len = 0;
if (errno != EINVAL || getsockopt(tds->s, SOL_SOCKET,
SO_ERROR, (char *) &len, (socklen_t *) &optlen) != 0) {
tdsdump_log(TDS_DBG_ERROR, "getsockopt(2) failed:
%s\n",
strerror(sock_errno));
goto not_available;
}
#else
tdsdump_log(TDS_DBG_ERROR, "getsockopt(2) failed: %s\n",
strerror(sock_errno));
goto not_available;
#endif
}



getsockopt definition in HP-UX is not that fine.... assuming different
size of last parameter is not that fine... and this change chaning
definitions or even linker options :(
This code try first with 8 byte socklen_t and than with 4 byte version.

freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page