Re: [HACKERS] win32 socket definition

2010-01-10 Thread Magnus Hagander
On Sun, Jan 10, 2010 at 13:44, Magnus Hagander wrote: > On Sun, Jan 10, 2010 at 13:33, James Mansion > wrote: >> Tom Lane wrote: >>> >>> There's another copy of ListenSocket[] in the BackendParameters struct. >>> I also wonder about postmaster.c's habit of using -1 for empty slots >>> in ListenSo

Re: [HACKERS] win32 socket definition

2010-01-10 Thread Magnus Hagander
On Sun, Jan 10, 2010 at 13:33, James Mansion wrote: > Tom Lane wrote: >> >> There's another copy of ListenSocket[] in the BackendParameters struct. >> I also wonder about postmaster.c's habit of using -1 for empty slots >> in ListenSocket ... how safe is that for Win64? >> > > On Windows, it shoul

Re: [HACKERS] win32 socket definition

2010-01-10 Thread James Mansion
Tom Lane wrote: There's another copy of ListenSocket[] in the BackendParameters struct. I also wonder about postmaster.c's habit of using -1 for empty slots in ListenSocket ... how safe is that for Win64? On Windows, it should be INVALID_SOCKET. James -- Sent via pgsql-hackers mailing list

Re: [HACKERS] win32 socket definition

2010-01-09 Thread Tom Lane
Magnus Hagander writes: > On Wed, Jan 6, 2010 at 22:42, Tom Lane wrote: >> Can't think of one, but you could try grepping for the socket-related >> syscalls to see what variables are referenced there. > Found two more by going over it again that way. > Unless there are objections, I will apply

Re: [HACKERS] win32 socket definition

2010-01-09 Thread Magnus Hagander
On Wed, Jan 6, 2010 at 22:42, Tom Lane wrote: > Magnus Hagander writes: >> Is there a good trick to find out if you've touched every place you >> need to, because I'm very unsure I have. I don't even get a warning in >> more than those two places, but there ought to be some way to trick >> the sy

Re: [HACKERS] win32 socket definition

2010-01-06 Thread Tom Lane
Magnus Hagander writes: > On Wed, Jan 6, 2010 at 23:17, Tom Lane wrote: >> BTW, I trust the non-windows case should be "int". > Haha, yeah, that was my attempt at producing a warning. Which didn't work :-) Hmm ... "char *" would provoke warnings, but only in the places that were using the new d

Re: [HACKERS] win32 socket definition

2010-01-06 Thread Magnus Hagander
On Wed, Jan 6, 2010 at 23:17, Tom Lane wrote: > Magnus Hagander writes: >> + /* socket has a different definition on WIN32 */ >> + #ifndef WIN32 >> + typedef char pgsocket; >> + #else >> + typedef SOCKET pgsocket; >> + #endif > > BTW, I trust the non-windows case should be "int". Haha, yeah, tha

Re: [HACKERS] win32 socket definition

2010-01-06 Thread Tom Lane
Magnus Hagander writes: > + /* socket has a different definition on WIN32 */ > + #ifndef WIN32 > + typedef char pgsocket; > + #else > + typedef SOCKET pgsocket; > + #endif BTW, I trust the non-windows case should be "int". regards, tom lane -- Sent via pgsql-hackers mai

Re: [HACKERS] win32 socket definition

2010-01-06 Thread Tom Lane
Magnus Hagander writes: > Is there a good trick to find out if you've touched every place you > need to, because I'm very unsure I have. I don't even get a warning in > more than those two places, but there ought to be some way to trick > the system to tell me? Can't think of one, but you could t

Re: [HACKERS] win32 socket definition

2010-01-06 Thread Magnus Hagander
On Fri, Jan 1, 2010 at 20:55, Magnus Hagander wrote: > On Fri, Jan 1, 2010 at 20:41, Tom Lane wrote: >> Magnus Hagander writes: >>> The win64 port has showed that we have two sockets declared >>> incorrectly. They are supposed to be declared as SOCKET on win32, but >>> they are declared as int.

Re: [HACKERS] win32 socket definition

2010-01-03 Thread Magnus Hagander
On Sun, Jan 3, 2010 at 17:45, Peter Eisentraut wrote: > On fre, 2010-01-01 at 20:25 +0100, Magnus Hagander wrote: >> The win64 port has showed that we have two sockets declared >> incorrectly. They are supposed to be declared as SOCKET on win32, but >> they are declared as int. See attached patch.

Re: [HACKERS] win32 socket definition

2010-01-03 Thread Peter Eisentraut
On fre, 2010-01-01 at 20:25 +0100, Magnus Hagander wrote: > The win64 port has showed that we have two sockets declared > incorrectly. They are supposed to be declared as SOCKET on win32, but > they are declared as int. See attached patch. > > Given that SOCKET is actually defined as int on win32

Re: [HACKERS] win32 socket definition

2010-01-01 Thread Magnus Hagander
On Fri, Jan 1, 2010 at 20:41, Tom Lane wrote: > Magnus Hagander writes: >> The win64 port has showed that we have two sockets declared >> incorrectly. They are supposed to be declared as SOCKET on win32, but >> they are declared as int. See attached patch. > >> Given that SOCKET is actually defin

Re: [HACKERS] win32 socket definition

2010-01-01 Thread Tom Lane
Magnus Hagander writes: > The win64 port has showed that we have two sockets declared > incorrectly. They are supposed to be declared as SOCKET on win32, but > they are declared as int. See attached patch. > Given that SOCKET is actually defined as int on win32 (no warnings or > anything there, j

[HACKERS] win32 socket definition

2010-01-01 Thread Magnus Hagander
The win64 port has showed that we have two sockets declared incorrectly. They are supposed to be declared as SOCKET on win32, but they are declared as int. See attached patch. Given that SOCKET is actually defined as int on win32 (no warnings or anything there, just on win64), I'm inclined to appl