diff --git a/ChangeLog b/ChangeLog index 419fbba4ad..fac30367bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 17 18:03:39 GMT 2008 Daniel P. Berrange + + * qemud/qemud.c, src/util.c, tests/testutils.c: Remove use + of _PATH_DEVNULL in favour of "/dev/null" for portability + (John Levon) + Wed Dec 17 18:10:51 +0100 2008 Jim Meyering enforce the "include first" rule diff --git a/qemud/qemud.c b/qemud/qemud.c index d0cbbe2f3a..ed9c594a36 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -406,9 +406,9 @@ static int qemudGoDaemon(void) { int stdoutfd = -1; int nextpid; - if ((stdinfd = open(_PATH_DEVNULL, O_RDONLY)) < 0) + if ((stdinfd = open("/dev/null", O_RDONLY)) < 0) goto cleanup; - if ((stdoutfd = open(_PATH_DEVNULL, O_WRONLY)) < 0) + if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0) goto cleanup; if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO) goto cleanup; diff --git a/src/util.c b/src/util.c index 9eda378509..904f659566 100644 --- a/src/util.c +++ b/src/util.c @@ -205,10 +205,10 @@ __virExec(virConnectPtr conn, return -1; } - if ((null = open(_PATH_DEVNULL, O_RDONLY)) < 0) { + if ((null = open("/dev/null", O_RDONLY)) < 0) { ReportError(conn, VIR_ERR_INTERNAL_ERROR, _("cannot open %s: %s"), - _PATH_DEVNULL, strerror(errno)); + "/dev/null", strerror(errno)); goto cleanup; } diff --git a/tests/testutils.c b/tests/testutils.c index 187123cc2a..7c6ae61b1c 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -35,10 +35,6 @@ #include #endif -#ifndef _PATH_DEVNULL -#define _PATH_DEVNULL "/dev/null" -#endif - #define GETTIMEOFDAY(T) gettimeofday(T, NULL) #define DIFF_MSEC(T, U) \ ((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \ @@ -155,9 +151,9 @@ void virtTestCaptureProgramExecChild(const char *const argv[], NULL }; - if ((stdinfd = open(_PATH_DEVNULL, O_RDONLY)) < 0) + if ((stdinfd = open("/dev/null", O_RDONLY)) < 0) goto cleanup; - if ((stderrfd = open(_PATH_DEVNULL, O_WRONLY)) < 0) + if ((stderrfd = open("/dev/null", O_WRONLY)) < 0) goto cleanup; open_max = sysconf (_SC_OPEN_MAX);