pgsql: Reset properly errno before calling write() - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Reset properly errno before calling write()
Date
Msg-id E1fm3G4-0003Hv-3Y@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Reset properly errno before calling write()

6cb3372 enforces errno to ENOSPC when less bytes than what is expected
have been written when it is unset, though it forgot to properly reset
errno before doing a system call to write(), causing errno to
potentially come from a previous system call.

Reported-by: Tom Lane
Author: Michael Paquier
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/31797.1533326676@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7124e64520834cd238c9f0efcfe429c28696b11d

Modified Files
--------------
src/backend/access/heap/rewriteheap.c           | 1 +
src/backend/access/transam/twophase.c           | 1 +
src/backend/replication/logical/origin.c        | 3 +++
src/backend/replication/logical/reorderbuffer.c | 1 +
src/backend/replication/logical/snapbuild.c     | 1 +
src/backend/replication/slot.c                  | 1 +
src/bin/pg_basebackup/walmethods.c              | 6 ++++++
7 files changed, 14 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Address set of issues with errno handling
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Address set of issues with errno handling