Re: Testing the return value of fclose() in the backend

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Testing the return value of fclose() in the backend
Дата
Msg-id 17549.1054352170@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Testing the return value of fclose() in the backend  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Testing the return value of fclose() in the backend  (Gavin Sherry <swm@linuxworld.com.au>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Gavin Sherry wrote:
>> There are various places in the backend, such as FreeFile(), where the
>> return value of fclose() is not tested.

> We are not checking fclose, probably because fclose failures are quite
> rare.  Should we be concerned?

Probably.  Closing a valid file descriptor in itself can't provoke any
error that I can imagine, but fclose() also implies fflush() --- so if
you have written data that hasn't yet been forced out of the stdio
buffers then out-of-disk-space is certainly a foreseeable failure.

fclose failure on an open-for-read-only file seems like Assert()
material; it "can't happen".
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Compressing Fields?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: default locale considered harmful? (was Re: [GENERAL]