summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/timeline.c
diff options
context:
space:
mode:
authorPeter Eisentraut2019-07-06 21:18:46 +0000
committerPeter Eisentraut2019-07-07 13:28:49 +0000
commit7e9a4c5c3dca0d9637812d8991e96fc8f46800d9 (patch)
treeea48b3d7e575d88a8e4afeb9040dab178f9a2dab /src/backend/access/transam/timeline.c
parentd1a040543b49e0aad273e7766cd7e2fcf2b781fa (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/access/transam/timeline.c')
-rw-r--r--src/backend/access/transam/timeline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c
index cbd9b2cee19..c2ba480c703 100644
--- a/src/backend/access/transam/timeline.c
+++ b/src/backend/access/transam/timeline.c
@@ -371,7 +371,7 @@ writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
pgstat_report_wait_end();
}
- if (CloseTransientFile(srcfd))
+ if (CloseTransientFile(srcfd) != 0)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not close file \"%s\": %m", path)));
@@ -415,7 +415,7 @@ writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
errmsg("could not fsync file \"%s\": %m", tmppath)));
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)));
@@ -493,7 +493,7 @@ writeTimeLineHistoryFile(TimeLineID tli, char *content, int size)
errmsg("could not fsync file \"%s\": %m", tmppath)));
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)));