[PATCH 2/3] Use g_mkdtemp instead of mkdtemp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prefer the GLib version to the one from gnulib.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/qemu/qemu_process.c      | 2 +-
 tests/fdstreamtest.c         | 2 +-
 tests/qemuhotplugtest.c      | 2 +-
 tests/qemumemlocktest.c      | 2 +-
 tests/qemumonitortestutils.c | 2 +-
 tests/qemuxml2argvtest.c     | 2 +-
 tests/qemuxml2xmltest.c      | 2 +-
 tests/scsihosttest.c         | 2 +-
 tests/testutilsqemu.c        | 4 ++--
 tests/vircgrouptest.c        | 2 +-
 tests/virhostdevtest.c       | 2 +-
 tests/virnetsockettest.c     | 4 ++--
 tests/virpcitest.c           | 2 +-
 tests/virscsitest.c          | 2 +-
 14 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 4cf4069d50..a669fc608f 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8508,7 +8508,7 @@ qemuProcessQMPInit(qemuProcessQMPPtr proc)
 
     template = g_strdup_printf("%s/qmp-XXXXXX", proc->libDir);
 
-    if (!(proc->uniqDir = mkdtemp(template))) {
+    if (!(proc->uniqDir = g_mkdtemp(template))) {
         virReportSystemError(errno,
                              _("Failed to create unique directory with "
                                "template '%s' for probing QEMU"),
diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c
index f4d38d5a20..03f5520fa6 100644
--- a/tests/fdstreamtest.c
+++ b/tests/fdstreamtest.c
@@ -319,7 +319,7 @@ mymain(void)
     char scratchdir[] = SCRATCHDIRTEMPLATE;
     int ret = 0;
 
-    if (!mkdtemp(scratchdir)) {
+    if (!g_mkdtemp(scratchdir)) {
         virFilePrintf(stderr, "Cannot create fdstreamdir");
         abort();
     }
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index a0a579f29a..5356785fa4 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -593,7 +593,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index d5a4fb1268..52cd9f9f26 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -62,7 +62,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index d7ecdb2ef9..617a2997d1 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -1045,7 +1045,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
 
     tmpdir_template = g_strdup("/tmp/libvirt_XXXXXX");
 
-    if (!(test->tmpdir = mkdtemp(tmpdir_template))) {
+    if (!(test->tmpdir = g_mkdtemp(tmpdir_template))) {
         virReportSystemError(errno, "%s",
                              "Failed to create temporary directory");
         goto error;
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index f0405866e1..5e1d6a45c5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -609,7 +609,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 8b256b9b19..08c85d3b73 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -142,7 +142,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/scsihosttest.c b/tests/scsihosttest.c
index b35ec6980a..e8193836ff 100644
--- a/tests/scsihosttest.c
+++ b/tests/scsihosttest.c
@@ -250,7 +250,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         goto cleanup;
     }
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 6fe385e545..5a7011478b 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -709,14 +709,14 @@ int qemuTestDriverInit(virQEMUDriver *driver)
     driver->config->libDir = g_strdup("/tmp/lib");
     driver->config->channelTargetDir = g_strdup("/tmp/channel");
 
-    if (!mkdtemp(statedir)) {
+    if (!g_mkdtemp(statedir)) {
         virFilePrintf(stderr, "Cannot create fake stateDir");
         goto error;
     }
 
     driver->config->stateDir = g_strdup(statedir);
 
-    if (!mkdtemp(configdir)) {
+    if (!g_mkdtemp(configdir)) {
         virFilePrintf(stderr, "Cannot create fake configDir");
         goto error;
     }
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index e1770426d7..c952676c25 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -989,7 +989,7 @@ initFakeFS(const char *mode,
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index 1f3f730433..ed8e7e8fc1 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -502,7 +502,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 4e9f201e45..3a5959b27e 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -191,7 +191,7 @@ testSocketAccept(const void *opaque)
 
     if (!data) {
         virNetSocketPtr usock;
-        tmpdir = mkdtemp(template);
+        tmpdir = g_mkdtemp(template);
         if (tmpdir == NULL) {
             VIR_WARN("Failed to create temporary directory");
             goto cleanup;
@@ -315,7 +315,7 @@ static int testSocketUNIXAddrs(const void *data G_GNUC_UNUSED)
     char *tmpdir;
     char template[] = "/tmp/libvirt_XXXXXX";
 
-    tmpdir = mkdtemp(template);
+    tmpdir = g_mkdtemp(template);
     if (tmpdir == NULL) {
         VIR_WARN("Failed to create temporary directory");
         goto cleanup;
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index d6dbe8c1ef..21dd538232 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -330,7 +330,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         VIR_TEST_DEBUG("Cannot create fakerootdir");
         abort();
     }
diff --git a/tests/virscsitest.c b/tests/virscsitest.c
index 4d40f2bb82..d5a0da4753 100644
--- a/tests/virscsitest.c
+++ b/tests/virscsitest.c
@@ -194,7 +194,7 @@ mymain(void)
 
     virscsi_prefix = g_strdup_printf("%s" VIR_SCSI_DATA, abs_srcdir);
 
-    tmpdir = mkdtemp(template);
+    tmpdir = g_mkdtemp(template);
 
     if (tmpdir == NULL) {
         VIR_WARN("Failed to create temporary directory");
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux