Re: Win32 testing needed - Mailing list pgsql-hackers-win32

From Andreas Pflug
Subject Re: Win32 testing needed
Date
Msg-id 4113D930.2060406@pse-consulting.de
Whole thread Raw
In response to Re: Win32 testing needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Win32 testing needed
List 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 by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: Win32 testing needed
Next
From: Bob.Henkel@hartfordlife.com
Date:
Subject: current binary build doesn't unzip