The macros NULL_DEV and DEVNULL were both used to work around
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 11 Dec 2008 10:25:17 +0000 (10:25 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 11 Dec 2008 10:25:17 +0000 (10:25 +0000)
platform-specific spellings of /dev/null.  But one should be enough, so
settle on DEVNULL.

src/backend/postmaster/postmaster.c
src/backend/postmaster/syslogger.c
src/include/c.h

index 6dcc96471214e3c9f15cc695e4bb1486945f802b..cef453bafdba8cbaace8dbde68af53c973a6e8a3 100644 (file)
@@ -1181,7 +1181,7 @@ pmdaemonize(void)
                ExitPostmaster(1);
        }
 #endif
-       i = open(NULL_DEV, O_RDWR, 0);
+       i = open(DEVNULL, O_RDWR, 0);
        dup2(i, 0);
        dup2(i, 1);
        dup2(i, 2);
index 4f79d01a319ef66d4e19c7fdb6fb38bcc5c0f45c..9c7d8dbc8d8e32c8b20e16d5a72dae66dcf63762 100644 (file)
@@ -184,7 +184,7 @@ SysLoggerMain(int argc, char *argv[])
         */
        if (redirection_done)
        {
-               int                     fd = open(NULL_DEV, O_WRONLY, 0);
+               int                     fd = open(DEVNULL, O_WRONLY, 0);
 
                /*
                 * The closes might look redundant, but they are not: we want to be
index 4d55fddf7284223e27ec3dc62fe4d54a77e5eabd..9ec4c65bfcbecd7f0aa76316e6a061fe20e3826d 100644 (file)
@@ -769,9 +769,6 @@ typedef NameData *Name;
 #define PG_BINARY_W "w"
 #endif
 
-/* These are for things that are one way on Unix and another on NT */
-#define NULL_DEV               "/dev/null"
-
 /*
  * Provide prototypes for routines not present in a particular machine's
  * standard C library.