Re: Fix some error handling for read() and errno
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Magnus Hagander <magnus@hagander.net>,
Alvaro Herrera <alvherre@2ndquadrant.com>, Robbie Harwood <rharwood@redhat.com>,
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>, hlinnaka <hlinnaka@iki.fi>
Date: 2018-06-22T12:46:31Z
Lists: pgsql-hackers
On Thu, Jun 21, 2018 at 2:32 AM, Michael Paquier <michael@paquier.xyz> wrote: > Sure. I have looked at that and I am finishing with the updated version > attached. > > I removed the portion about slru in the code, but I would like to add at > least a mention about it in the commit message. The simplifications are > also applied for the control file messages you changed as well in > cfb758b. Also in ReadControlFile(), we use "could not open control > file", so for consistency this should be replaced with a more simple > message. I noticed as well that the 2PC file handling loses errno a > couple of times, and that we had better keep the messages also > consistent if we do the simplification move... relmapper.c also gains > simplifications. > > All the incorrect errno handling I found should be back-patched in my > opinion as we did so in the past with 2a11b188 for example. I am not > really willing to bother about the error message improvements on > anything else than HEAD (not v11, but v12), but... Opinions about all > that? I think this should be split into two patches. Fixing failure to save and restore errno is a different issue from cleaning up short write messages. I agree that the former should be back-patched and the latter not. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Rework error messages around file handling
- 811b6e36a9e2 12.0 landed