Re: Incorrect errno used with %m for backend code - Mailing list pgsql-hackers

From Ashutosh Sharma
Subject Re: Incorrect errno used with %m for backend code
Date
Msg-id CAE9k0P=-M-aTupoSju91mFpnwfs5AogXX=NUmnMsJ0QuYVNwvQ@mail.gmail.com
Whole thread Raw
In response to Re: Incorrect errno used with %m for backend code  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Incorrect errno used with %m for backend code
List pgsql-hackers
On Sat, Jun 23, 2018 at 6:43 PM, Michael Paquier <michael@paquier.xyz> wrote:
> On Fri, Jun 22, 2018 at 03:45:33PM +0530, Ashutosh Sharma wrote:
>> Okay, thanks for the confirmation. Few of them are also there in
>> origin.c and snapbuild.c files.
>
> Thanks Ashutosh.  I have been reviewing the whole tree and I found more
> places where this is missing, like rewriteheap.c, reorderbuffer.c or
> pg_basebackup, which gives the attached.
> --

Okay, I too had a quick look into the source code to see if there are
still some places where we could have missed to set an errno to ENOSPC
in case of write system call failure but, couldn't find any such place
in the code. The v2 version of patch looks good to me.

So, to conclude, now, v2 patch fixes two things - 1) It makes ereport
to print a correct error number (the error number that matches with
the error message), 2) It sets the errno to ENOSPC (assuming that the
problem is no disk space) if write system call fails to set an errno.

-- 
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Keeping temporary tables in shared buffers
Next
From: Bruce Momjian
Date:
Subject: Re: utilities to rebuild commit logs from wal