1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

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
This commit is contained in:
Peter Eisentraut
2019-07-06 23:18:46 +02:00
parent d1a040543b
commit 7e9a4c5c3d
19 changed files with 45 additions and 45 deletions

View File

@@ -1315,7 +1315,7 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
}
pgstat_report_wait_end();
if (CloseTransientFile(fd))
if (CloseTransientFile(fd) != 0)
{
ereport(elevel,
(errcode_for_file_access(),
@@ -1472,7 +1472,7 @@ RestoreSlotFromDisk(const char *name)
path, readBytes, (Size) cp.length)));
}
if (CloseTransientFile(fd))
if (CloseTransientFile(fd) != 0)
ereport(PANIC,
(errcode_for_file_access(),
errmsg("could not close file \"%s\": %m", path)));