Re: BUG #14999: pg_rewind corrupts control file global/pg_control
От | Dmitry Dolgov |
---|---|
Тема | Re: BUG #14999: pg_rewind corrupts control file global/pg_control |
Дата | |
Msg-id | CA+q6zcWeFmGc=uC5CwL7HznL25nCqh0CvepgtyuGQo1duStE+w@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #14999: pg_rewind corrupts control file global/pg_control (Michael Paquier <michael@paquier.xyz>) |
Ответы |
Re: BUG #14999: pg_rewind corrupts control file global/pg_control
|
Список | pgsql-bugs |
> On 27 February 2018 at 02:24, Michael Paquier <michael@paquier.xyz> wrote: > > Note that I am still not completely happy with the > handling in errno in some newly-added code paths.. It maybe a stupid question, but why do you need to reset errno here? Is it to avoid its value being carried from previous calls of `open_target_file`? In this case if you put the code with `errno == EACCESS` under the if condition `if (dstfd < 0)`, then as far as I remember you should always get relevant errno. At the same time maybe it's valid to reset `errno` before `open`, like with `getpriority`: For some system calls and library functions (e.g., getpriority(2)), -1 is a valid return on success. In such cases, a successful return can be distinguished from an error return by setting errno to zero before the call, and then, if the call returns a status that indicates that an error may have occurred, checking to see if errno has a nonzero value.
В списке pgsql-bugs по дате отправления: