pgsql: Fix fd.c to preserve errno where needed.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix fd.c to preserve errno where needed.
Дата
Msg-id E1Ud3UZ-000240-Vv@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix fd.c to preserve errno where needed.

PathNameOpenFile failed to ensure that the correct value of errno was
returned to its caller after a failure (because it incorrectly supposed
that free() can never change errno).  In some cases this would result
in a user-visible failure because an expected ENOENT errno was replaced
with something else.  Bogus EINVAL failures have been observed on OS X,
for example.

There were also a couple of places that could mangle an important value
of errno if FDDEBUG was defined.  While the usefulness of that debug
support is highly debatable, we might as well make it safe to use,
so add errno save/restore logic to the DO_DB macro.

Per bug #8167 from Nelson Minar, diagnosed by RhodiumToad.
Back-patch to all supported branches.

Branch
------
REL9_2_STABLE

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

Modified Files
--------------
src/backend/storage/file/fd.c |   17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix fd.c to preserve errno where needed.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix fd.c to preserve errno where needed.