git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b7f3981) | patch
Check return value of pclose() correctly
2022年11月15日 14:35:37 +0000 (15:35 +0100)
2022年11月15日 14:36:51 +0000 (15:36 +0100)
commit 2fe3bdbd691a5d11626308e7d660440be6c210c8
Check return value of pclose() correctly

Some callers didn't check the return value of pclose() or
ClosePipeStream() correctly. Either they didn't check it at all or
they treated it like the return of fclose().

The correct way is to first check whether the return value is -1, and
then report errno, and then check the return value like a result from
system(), for which we already have wait_result_to_str() to make it
simpler. To make this more compact, expand wait_result_to_str() to
also handle -1 explicitly.

Reviewed-by: Ankit Kumar Pandey <itsankitkp@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/8cd9fb02-bc26-65f1-a809-b1cb360eef73@enterprisedb.com
src/backend/commands/collationcmds.c diff | blob | blame | history
src/bin/pg_ctl/pg_ctl.c diff | blob | blame | history
src/bin/pg_upgrade/controldata.c diff | blob | blame | history
src/bin/pg_upgrade/exec.c diff | blob | blame | history
src/bin/pg_upgrade/option.c diff | blob | blame | history
src/bin/pgbench/pgbench.c diff | blob | blame | history
src/bin/psql/command.c diff | blob | blame | history
src/common/wait_error.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /