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
|
| Список | 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 по дате отправления: