Re: pg_logging_init() can return ENOTTY with TAP tests
| От | Tom Lane |
|---|---|
| Тема | Re: pg_logging_init() can return ENOTTY with TAP tests |
| Дата | |
| Msg-id | 445428.1600437374@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | pg_logging_init() can return ENOTTY with TAP tests (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: pg_logging_init() can return ENOTTY with TAP tests
|
| Список | pgsql-hackers |
Michael Paquier <michael@paquier.xyz> writes:
> Some system calls may not set errno even if they succeed, like
> strtol() on Linux for example, so in this case it can cause option
> handling to fail because of the error set by logging initialization.
> Shouldn't we reset errno to 0 once logging initialization is done? It
> seems to me that this code path should finish with a clean sheet, and
> attached is a proposal of patch to address this issue.
No, this is a bad idea. The right place to fix this is whatever code
segment is relying on errno to be initially zero; that is NEVER a sane
assumption. That is, a valid coding pattern is something like
errno = 0;
strtol(...);
if (errno) ...
regards, tom lane
В списке pgsql-hackers по дате отправления: