pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use consistent style for checking return from system calls
Date: Sun, 07 Jul 2019 14:34:06 +0000
Message-ID: <E1hk8Ew-0002jE-Sl@gemulon.postgresql.org> (raw)

Use consistent style for checking return from system calls

Use

    if (something() != 0)
        error ...

instead of just

    if (something)
        error ...

The latter is not incorrect, but it's a bit confusing and not the
common style.

Discussion: https://www.postgresql.org/message-id/flat/5de61b6b-8be9-7771-0048-860328efe027%402ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7e9a4c5c3dca0d9637812d8991e96fc8f46800d9

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |  2 +-
src/backend/access/heap/rewriteheap.c           |  4 ++--
src/backend/access/transam/slru.c               | 12 ++++++------
src/backend/access/transam/timeline.c           |  6 +++---
src/backend/access/transam/twophase.c           |  2 +-
src/backend/access/transam/xlog.c               | 14 +++++++-------
src/backend/libpq/be-fsstubs.c                  |  4 ++--
src/backend/postmaster/postmaster.c             |  2 +-
src/backend/replication/logical/origin.c        |  4 ++--
src/backend/replication/logical/reorderbuffer.c |  2 +-
src/backend/replication/logical/snapbuild.c     |  4 ++--
src/backend/replication/slot.c                  |  4 ++--
src/backend/replication/walsender.c             |  2 +-
src/backend/storage/file/copydir.c              |  4 ++--
src/backend/storage/file/fd.c                   | 10 +++++-----
src/backend/storage/ipc/dsm_impl.c              |  2 +-
src/backend/utils/cache/relmapper.c             |  4 ++--
src/common/controldata_utils.c                  |  6 +++---
src/interfaces/libpq/fe-lobj.c                  |  2 +-
19 files changed, 45 insertions(+), 45 deletions(-)



Message-ID: <E1hk8Ew-0002jE-Sl@gemulon.postgresql.org>
Permalink:  ../E1hk8Ew-0002jE-Sl@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hk8Ew-0002jE-Sl@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: peter@eisentraut.org
  Subject: Re: pgsql: Use consistent style for checking return from system calls
  In-Reply-To: <E1hk8Ew-0002jE-Sl@gemulon.postgresql.org>
  References: <E1hk8Ew-0002jE-Sl@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