]> xenbits.xensource.com Git - libvirt.git/commitdiff
Use g_mkdtemp instead of mkdtemp
authorJán Tomko <jtomko@redhat.com>
Wed, 13 Nov 2019 21:35:47 +0000 (22:35 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 14 Nov 2019 18:02:31 +0000 (19:02 +0100)
Prefer the GLib version to the one from gnulib.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
14 files changed:
src/qemu/qemu_process.c
tests/fdstreamtest.c
tests/qemuhotplugtest.c
tests/qemumemlocktest.c
tests/qemumonitortestutils.c
tests/qemuxml2argvtest.c
tests/qemuxml2xmltest.c
tests/scsihosttest.c
tests/testutilsqemu.c
tests/vircgrouptest.c
tests/virhostdevtest.c
tests/virnetsockettest.c
tests/virpcitest.c
tests/virscsitest.c

index 1192b4447dff75ccef2f45bb99626d1ae6d7ca9f..246934c634325e79c0f3544099d4d967c17dd9e4 100644 (file)
@@ -8447,7 +8447,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"),
index f4d38d5a20e2f45f97939b0450274f539344e51e..03f5520fa66255bece9d82da30d1d2d7bb3f2642 100644 (file)
@@ -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();
     }
index 000cfcfcadf3f4e9e5e8e651e3c51ab2a5f28d3a..a914a8a8b5f28a361a65d2c6974c3ae6500aeadc 100644 (file)
@@ -596,7 +596,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
index d5a4fb126824e8e765eefa0348ae1d38efa6ddf6..52cd9f9f26db2518e648f0f201971dd0c1143e40 100644 (file)
@@ -62,7 +62,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
index d7ecdb2ef92c13395b3651e060498122321ef702..617a2997d11c6a68aebf5776cebe78551aded490 100644 (file)
@@ -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;
index f839d77e8e8d6fd7947476928b4d53f824e3053b..9bb186ed95edee61c532aa7d7d24793ff4ffc50a 100644 (file)
@@ -609,7 +609,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
index c160988a1ba0b00f2dc29aac672c6575ecf3330d..757e0a33e151ac053a031cd716f589b0a9613491 100644 (file)
@@ -142,7 +142,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
index b35ec6980a67926f2d3660a1ccc84715c80414af..e8193836ff32d0864ad6862688189a615a33faab 100644 (file)
@@ -250,7 +250,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         goto cleanup;
     }
index 6fe385e545ab7c7bf40f1bd0984abe83a4d8c59d..5a7011478b89c4f7b5631ba6bbe1eab2dfce391d 100644 (file)
@@ -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;
     }
index e1770426d7f0fef91d03f5da0211dea2a7dd436c..c952676c25462a1f14f50d83c004fcfe5839f3fb 100644 (file)
@@ -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();
     }
index 1f3f73043392fcfe90e79e00459959dd08d6ecbc..ed8e7e8fc12fe5c9bc73afd5199c9fbe8f9b835e 100644 (file)
@@ -502,7 +502,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         fprintf(stderr, "Cannot create fakerootdir");
         abort();
     }
index 4e9f201e4577b17cdc3769abf3c8ced1ddf620d7..3a5959b27edf7c59206d77faa508e40192b12bed 100644 (file)
@@ -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;
index d6dbe8c1ef220e18168ee0009fdaddff4bfa9678..21dd5382321189c490c912b7b7ca037cab4a9653 100644 (file)
@@ -330,7 +330,7 @@ mymain(void)
 
     fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
 
-    if (!mkdtemp(fakerootdir)) {
+    if (!g_mkdtemp(fakerootdir)) {
         VIR_TEST_DEBUG("Cannot create fakerootdir");
         abort();
     }
index 4d40f2bb822dd39803c868308eb7c21fb0362af9..d5a0da475380a7ac68e4b9dd4cdaa7504a422743 100644 (file)
@@ -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");