Wrong definition of pgwin32_bind.
Wrong definition of pgwin32_bind.
От:
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Дата:
Hello.
VC complains that pgwin32_bind() had a parameter differs in
levels of indirection from definition. pgwin32_bind() in
src/backend/port/win32/socket.c is defined as the following.
> int pgwin32_bind(SOCKET s, struct sockaddr * addr, int *addrlen);
The third parameter should be int, not int*. It might have been
confused with pgwin32_accept.
The attached patch fixes this.
regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center
diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c
index ea4fb55..56a13e5 100644
--- a/src/backend/port/win32/socket.c
+++ b/src/backend/port/win32/socket.c
@@ -265,7 +265,7 @@ pgwin32_socket(int af, int type, int protocol)}int
-pgwin32_bind(SOCKET s, struct sockaddr * addr, int *addrlen)
+pgwin32_bind(SOCKET s, struct sockaddr * addr, int addrlen){ int res;
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 9810a83..708d47a 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -373,7 +373,7 @@ void pg_queue_signal(int signum);#define send(s, buf, len, flags) pgwin32_send(s, buf, len, flags)SOCKET pgwin32_socket(int af, int type, int protocol);
-int pgwin32_bind(SOCKET s, struct sockaddr * addr, int *addrlen);
+int pgwin32_bind(SOCKET s, struct sockaddr * addr, int addrlen);int pgwin32_listen(SOCKET s, int backlog);SOCKET pgwin32_accept(SOCKET s, struct sockaddr * addr, int *addrlen);int pgwin32_connect(SOCKET s, const struct sockaddr * name, int namelen);
Re: Wrong definition of pgwin32_bind.
От:
Michael Paquier <michael.paquier@gmail.com>
Дата:
On Thu, Apr 14, 2016 at 5:15 PM, Kyotaro HORIGUCHI wrote: > Hello. > > VC complains that pgwin32_bind() had a parameter differs in > levels of indirection from definition. pgwin32_bind() in > src/backend/port/win32/socket.c is defined as the following. > >> int pgwin32_bind(SOCKET s, struct sockaddr * addr, int *addrlen); > > The third parameter should be int, not int*. It might have been > confused with pgwin32_accept. > > The attached patch fixes this. Nice catch. -- Michael
Re: Wrong definition of pgwin32_bind.
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Michael Paquier writes: > On Thu, Apr 14, 2016 at 5:15 PM, Kyotaro HORIGUCHI > wrote: >> The third parameter should be int, not int*. It might have been >> confused with pgwin32_accept. > Nice catch. David Rowley reported this a bit earlier. regards, tom lane