Incorrect errno used with %m for backend code
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Postgres hackers <pgsql-hackers@postgresql.org>
Date: 2018-06-22T06:15:35Z
Lists: pgsql-hackers
Attachments
- errno-m-logs-v1.patch (text/x-diff) patch v1
Hi all, I have been reviewing the use of errno in the backend code when %m is used in the logs, and found more places than when I looked at improving the error messages for read() calls which bloat the errno value because of intermediate system calls. As the problem is separate and should be back-patched, I have preferred beginning a new thread. A couple of places use CloseTransientFile without bothering much that this can overwrite errno. I was tempted in keeping errno saved and kept if set to a non-zero value, but refrained from doing so as some callers may rely on the existing behavior, and the attached shows better the intention. Attached is a patch with everything I have spotted. Any opinions or thoughts in getting this back-patched? Thanks, -- Michael
Commits
-
Address set of issues with errno handling
- f53ed82b7fee 9.3.24 landed
- 79b5b101f992 9.4.19 landed
- 910e2aca129c 9.5.14 landed
- 7fdf56b0a796 9.6.10 landed
- 6eec6724ff45 10.5 landed
- 6cb3372411fd 11.0 landed