Fix some error handling for read() and errno
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Postgres hackers <pgsql-hackers@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Magnus Hagander <magnus@hagander.net>, Heikki Linnakangas <hlinnaka@iki.fi>
Date: 2018-05-20T00:05:22Z
Lists: pgsql-hackers
Attachments
- read-errno-handling.patch (text/x-diff) patch
Hi all, This is basically a new thread after what has been discussed for pg_controldata with its error handling for read(): https://www.postgresql.org/message-id/CABUevEx8ZRV5Ut_FvP2etXiQppx3xVzm7oOaV3AcdHxX81Yt8Q%40mail.gmail.com While reviewing the core code, I have noticed similar weird error handling for read(). At the same time, some of those places may use an incorrect errno, as an error is invoked using an errno which may be overwritten by another system call. I found a funny one in slru.c, for which I have added a note in the patch. I don't think that this is worth addressing with more facility, thoughts are welcome. Attached is a patch addressing the issues I found. Thanks, -- Michael
Commits
-
Rework error messages around file handling
- 811b6e36a9e2 12.0 landed