pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reset properly errno before calling write()
Date: Sat, 04 Aug 2018 20:34:40 +0000
Message-ID: <E1fm3G4-0003Hz-40@gemulon.postgresql.org> (raw)

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_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/afd5fde856675f54a7b5d857f7a173f9a3237b57

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/receivelog.c              | 2 ++
7 files changed, 10 insertions(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1fm3G4-0003Hz-40@gemulon.postgresql.org>
Permalink:  ../E1fm3G4-0003Hz-40@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fm3G4-0003Hz-40@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Reset properly errno before calling write()
  In-Reply-To: <E1fm3G4-0003Hz-40@gemulon.postgresql.org>
  References: <E1fm3G4-0003Hz-40@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox