Check return value of pclose() correctly

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Check return value of pclose() correctly
Дата
Msg-id 8cd9fb02-bc26-65f1-a809-b1cb360eef73@enterprisedb.com
обсуждение исходный текст
Ответы Re: Check return value of pclose() correctly  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
I noticed that some (not all) 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().  Here is a patch 
with fixes.

(A failure to run the command issued by popen() is usually reported via 
the pclose() status, so while you can often get away with not checking 
fclose() or close(), checking pclose() is more often useful.)

There are some places where the return value is apparently intentionally 
ignored, such as in error recovery paths, or psql ignoring a failure to 
launch the pager.  (The intention can usually be inferred by the kind of 
error checking attached to the corresponding popen() call.)  But there 
are a few places in psql that I'm suspicious about that I have marked, 
but need to think about further.
Вложения

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

Предыдущее
От: Peter Smith
Дата:
Сообщение: Re: Support logical replication of DDLs
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: heavily contended lwlocks with long wait queues scale badly