Re: Syslogger tries to write to /dev/null on Windows - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Syslogger tries to write to /dev/null on Windows
Date
Msg-id 22041.1270153134@sss.pgh.pa.us
Whole thread Raw
In response to Re: Syslogger tries to write to /dev/null on Windows  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Syslogger tries to write to /dev/null on Windows  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-bugs
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> The open() fails and returns a return code as you would expect. But the
> dup2() call crashes when passed an invalid file descriptor, I just
> tested that with a small test program on Windows.

Ah, thanks Windows :-(

> !         if (fd != -1)
> !         {
> !             dup2(fd, fileno(stdout));
> !             dup2(fd, fileno(stderr));
> !             close(fd);
> !         }

+1 for fixing it like this.  It's cleaner anyway.

Is that actually the cause of the original bug report, or is there
another issue yet to solve?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Syslogger tries to write to /dev/null on Windows
Next
From: Heikki Linnakangas
Date:
Subject: Re: Syslogger tries to write to /dev/null on Windows