pgsql: Don't pass an invalid file handle to dup2(). - Mailing list pgsql-committers

From heikki@postgresql.org (Heikki Linnakangas)
Subject pgsql: Don't pass an invalid file handle to dup2().
Date
Msg-id 20100401201234.A29ED7541D0@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Don't pass an invalid file handle to dup2(). That causes a crash on
Windows, thanks to a feature in CRT called Parameter Validation.

Backpatch to 8.2, which is the oldest version supported on Windows. In
8.2 and 8.3 also backpatch the earlier change to use DEVNULL instead of
NULL_DEV #define for a /dev/null-like device. NULL_DEV was hard-coded to
"/dev/null" regardless of platform, which didn't work on Windows, while
DEVNULL works on all platforms. Restarting syslogger didn't work on
Windows on versions 8.3 and below because of that.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/postmaster:
        postmaster.c (r1.551.2.5 -> r1.551.2.6)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c?r1=1.551.2.5&r2=1.551.2.6)
        syslogger.c (r1.44.2.2 -> r1.44.2.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/syslogger.c?r1=1.44.2.2&r2=1.44.2.3)
    pgsql/src/include:
        c.h (r1.222.2.2 -> r1.222.2.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/c.h?r1=1.222.2.2&r2=1.222.2.3)

pgsql-committers by date:

Previous
From: heikki@postgresql.org (Heikki Linnakangas)
Date:
Subject: pgsql: Don't pass an invalid file handle to dup2().
Next
From: heikki@postgresql.org (Heikki Linnakangas)
Date:
Subject: pgsql: Don't pass an invalid file handle to dup2().