Re: Win32 testing needed

Поиск
Список
Период
Сортировка
От Andreas Pflug
Тема Re: Win32 testing needed
Дата
Msg-id 4113D930.2060406@pse-consulting.de
обсуждение исходный текст
Ответ на Re: Win32 testing needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Win32 testing needed
Список pgsql-hackers-win32
Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.de> writes:

> 
> Agreed (although actually I was thinking of preserving
> write_syslogger_file as the externally visible name and renaming the
> existing function to a static "write_syslogger_file_binary" or some such
> --- fewer files to touch that way).  Do you have time to write and check
> this today?  I could write it but am not in a good position to test it.

The attached code snippet works. I hesitated to use palloc(count*2) to 
avoid problems in low mem conditions; might be paranoid.

Regards,
Andreas

void
write_syslogger_file(const char *buffer, int count)
{
    char convbuf[1024+1], *p=convbuf;
    int i;
    
    for (i=0 ; *buffer != 0 && i < 1024 && count > 0 ; i++, count--)
    {
        if (*buffer == '\n')
        {
            i++;
            *p++ = '\r';
        }
        *p++ = *buffer++;
    }
    write_syslogger_file_binary(convbuf, i);
}

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

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: Win32 testing needed
Следующее
От: Bob.Henkel@hartfordlife.com
Дата:
Сообщение: current binary build doesn't unzip