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: christos AT zoulas.com (Christos Zoulas)
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Getting it to all work on HPUX
  • Date: Fri, 6 Feb 2009 10:16:49 -0500

On Feb 6, 2:53pm, freddy77 AT gmail.com (Frediano Ziglio) wrote:
-- 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.

I think we should use an autoconf test to detect the presence of socklen_t
instead of resorting to such ugliness .

christos




Archive powered by MHonArc 2.6.24.

Top of Page