1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-25 20:23:07 +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

@@ -853,7 +853,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename)
}
/* if we already failed, don't overwrite that msg with a close error */
if (close(fd) && result >= 0)
if (close(fd) != 0 && result >= 0)
{
printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("could not write to file \"%s\": %s\n"),