Re: pgsql: Provide errno-translation wrappers around bind() and listen() on

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Provide errno-translation wrappers around bind() and listen() on
Date: 2016-04-14 04:48:45
Message-ID: CAKJS1f-uREo0s3b1Voa0hJO49ExXTDXs1gDYQfDwGmG+VCZe_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 13 April 2016 at 11:52, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Provide errno-translation wrappers around bind() and listen() on Windows.
>
> I've seen one too many "could not bind IPv4 socket: No error" log entries
> from the Windows buildfarm members. Per previous discussion, this is
> likely caused by the fact that we're doing nothing to translate
> WSAGetLastError() to errno. Put in a wrapper layer to do that.
>
> If this works as expected, it should get back-patched, but let's see what
> happens in the buildfarm first.
>
> Discussion: <4065(dot)1452450340(at)sss(dot)pgh(dot)pa(dot)us>

My windows machine gives me a bunch of new warnings with this:

src/backend/libpq/auth.c(1620): warning C4047: 'function' : 'int *'
differs in levels of indirection from 'size_t'
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/libpq/auth.c(1620): warning C4024: 'pgwin32_bind' :
different types for formal and actual parameter 3
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/libpq/auth.c(2606): warning C4047: 'function' : 'int *'
differs in levels of indirection from 'int'
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/libpq/auth.c(2606): warning C4024: 'pgwin32_bind' :
different types for formal and actual parameter 3
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/libpq/pqcomm.c(493): warning C4047: 'function' : 'int *'
differs in levels of indirection from 'size_t'
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/libpq/pqcomm.c(493): warning C4024: 'pgwin32_bind' :
different types for formal and actual parameter 3
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/port/win32/socket.c(272): warning C4047: 'function' :
'int' differs in levels of indirection from 'int *'
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/port/win32/socket.c(272): warning C4024: 'bind' :
different types for formal and actual parameter 3
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/postmaster/pgstat.c(396): warning C4047: 'function' :
'int *' differs in levels of indirection from 'size_t'
[L:\Projects\Postgres\a\postgres.vcxproj]
src/backend/postmaster/pgstat.c(396): warning C4024: 'pgwin32_bind'
: different types for formal and actual parameter 3
[L:\Projects\Postgres\a\postgres.vcxproj]

I'm not really sure why you made pgwin32_bind take a pointer to an
int, instead of just an int. I assume a mistake?

The attached fixes and gets rid of the warnings.

Attachment Content-Type Size
pgwin32_bind_fix.patch application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2016-04-14 06:31:21 Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Previous Message Michael Paquier 2016-04-14 04:22:38 Re: [COMMITTERS] pgsql: Add regression tests for multiple synchronous standbys.