pgsql: Further tweaking of the readfile() function in pg_ctl.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Further tweaking of the readfile() function in pg_ctl.
Дата
Msg-id E1TOvrO-0006Bo-Qo@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Further tweaking of the readfile() function in pg_ctl.

Don't leak a file descriptor if the file is empty or we can't read its size.

Expect there to be a newline at the end of the last line, too. If there
isn't, ignore anything after the last newline. This makes it a tiny bit
more robust in case the file is appended to concurrently, so that we don't
return the last line if it hasn't been fully written yet. And this makes
the code a bit less obscure, anyway. Per Tom Lane's suggestion.

Backpatch to all supported branches.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/d2a5f326568dfe98559319db6f3b9d08f0c851cc

Modified Files
--------------
src/bin/pg_ctl/pg_ctl.c |   15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Further tweaking of the readfile() function in pg_ctl.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Further tweaking of the readfile() function in pg_ctl.