Thread: pgsql: Reset properly errno before calling write()
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 ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e69a3ac4a3e0ba640264a94dded197c21c33aa11 Modified Files -------------- src/backend/access/heap/rewriteheap.c | 1 + src/backend/access/transam/twophase.c | 1 + src/backend/replication/logical/reorderbuffer.c | 1 + src/backend/replication/logical/snapbuild.c | 1 + src/backend/replication/slot.c | 1 + src/bin/pg_basebackup/receivelog.c | 2 ++ 6 files changed, 7 insertions(+)