diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-07-06 23:18:46 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-07-07 15:28:49 +0200 |
commit | 7e9a4c5c3dca0d9637812d8991e96fc8f46800d9 (patch) | |
tree | ea48b3d7e575d88a8e4afeb9040dab178f9a2dab /src/backend/replication/logical/snapbuild.c | |
parent | d1a040543b49e0aad273e7766cd7e2fcf2b781fa (diff) |
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
Diffstat (limited to 'src/backend/replication/logical/snapbuild.c')
-rw-r--r-- | src/backend/replication/logical/snapbuild.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index 3e9d4cd79f9..dc64b1e0c2f 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -1652,7 +1652,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn) } pgstat_report_wait_end(); - if (CloseTransientFile(fd)) + if (CloseTransientFile(fd) != 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not close file \"%s\": %m", tmppath))); @@ -1850,7 +1850,7 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn) } COMP_CRC32C(checksum, ondisk.builder.committed.xip, sz); - if (CloseTransientFile(fd)) + if (CloseTransientFile(fd) != 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not close file \"%s\": %m", path))); |