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/common/controldata_utils.c | |
parent | d1a040543b49e0aad273e7766cd7e2fcf2b781fa (diff) | |
download | postgresql-7e9a4c5c3dca0d9637812d8991e96fc8f46800d9.tar.gz postgresql-7e9a4c5c3dca0d9637812d8991e96fc8f46800d9.zip |
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/common/controldata_utils.c')
-rw-r--r-- | src/common/controldata_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/controldata_utils.c b/src/common/controldata_utils.c index 2c28e51e111..39c27c92292 100644 --- a/src/common/controldata_utils.c +++ b/src/common/controldata_utils.c @@ -106,13 +106,13 @@ get_controlfile(const char *DataDir, bool *crc_ok_p) } #ifndef FRONTEND - if (CloseTransientFile(fd)) + if (CloseTransientFile(fd) != 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not close file \"%s\": %m", ControlFilePath))); #else - if (close(fd)) + if (close(fd) != 0) { pg_log_fatal("could not close file \"%s\": %m", ControlFilePath); exit(EXIT_FAILURE); @@ -248,7 +248,7 @@ update_controlfile(const char *DataDir, #endif } - if (close(fd) < 0) + if (close(fd) != 0) { #ifndef FRONTEND ereport(PANIC, |