Re: use binary mode on syslog pipe on windows to avoid upsetting chunking protocol
| От | Tom Lane |
|---|---|
| Тема | Re: use binary mode on syslog pipe on windows to avoid upsetting chunking protocol |
| Дата | |
| Msg-id | 21267.1185808289@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | use binary mode on syslog pipe on windows to avoid upsetting chunking protocol (Andrew Dunstan <andrew@dunslane.net>) |
| Ответы |
Re: use binary mode on syslog pipe on windows to avoid
upsetting chunking protocol
|
| Список | pgsql-patches |
Andrew Dunstan <andrew@dunslane.net> writes:
> This small patch makes the syslog pipe use binary mode on Windows
You need to think harder about where you are inserting the additions,
as these choices seem a bit random. For instance here:
> /* On Windows, need to interlock against data-transfer thread */
> #ifdef WIN32
> + _setmode(_fileno(fh), _O_TEXT); /* use CRLF line endings on Windows */
> EnterCriticalSection(&sysfileSection);
> #endif
> fclose(syslogFile);
you have inserted a 100% unrelated action between a comment and the
statement it describes. How readable will this code be to the next
person? Far better to expend an additional #ifdef/#endif pair, if
needed, to put the call either by itself or with some code that it's
sensibly related to. Being "WIN32" is not sufficient connection.
regards, tom lane
В списке pgsql-patches по дате отправления: