]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove use of _PATH_DEVNULL in favour of /dev/null for portability (John Levon)
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 17 Dec 2008 18:04:55 +0000 (18:04 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 17 Dec 2008 18:04:55 +0000 (18:04 +0000)
ChangeLog
qemud/qemud.c
src/util.c
tests/testutils.c

index 419fbba4ad9715787807f26d5e7e9934fd6190b2..fac30367bbc3ab5b400e4f3d33090eaad8ff24bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Dec 17 18:03:39 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
+
+       * 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 <meyering@redhat.com>
 
        enforce the "include <config.h> first" rule
index d0cbbe2f3a17b3f69a0667749a4c3ae796a3bafc..ed9c594a36cf07b93636f92c9b9bf58de2a3bca0 100644 (file)
@@ -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;
index 9eda378509d16029528dd1ad38e65de52ad29034..904f659566966aaf443b1dc7fd8d01093820ed70 100644 (file)
@@ -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;
     }
 
index 187123cc2afeccecc90acbe06c722c8c5852650c..7c6ae61b1c67a378a36320bb451f758fca78cffc 100644 (file)
 #include <paths.h>
 #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);