Use g_mkdtemp instead of mkdtemp

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>
This commit is contained in:
Ján Tomko 2019-11-13 22:35:47 +01:00
parent 4ac4773040
commit ef88698668
14 changed files with 16 additions and 16 deletions

View 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"),

View 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();
}

View File

@ -596,7 +596,7 @@ mymain(void)
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
if (!mkdtemp(fakerootdir)) {
if (!g_mkdtemp(fakerootdir)) {
fprintf(stderr, "Cannot create fakerootdir");
abort();
}

View File

@ -62,7 +62,7 @@ mymain(void)
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
if (!mkdtemp(fakerootdir)) {
if (!g_mkdtemp(fakerootdir)) {
fprintf(stderr, "Cannot create fakerootdir");
abort();
}

View 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;

View File

@ -609,7 +609,7 @@ mymain(void)
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
if (!mkdtemp(fakerootdir)) {
if (!g_mkdtemp(fakerootdir)) {
fprintf(stderr, "Cannot create fakerootdir");
abort();
}

View File

@ -142,7 +142,7 @@ mymain(void)
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
if (!mkdtemp(fakerootdir)) {
if (!g_mkdtemp(fakerootdir)) {
fprintf(stderr, "Cannot create fakerootdir");
abort();
}

View 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;
}

View 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;
}

View 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();
}

View File

@ -502,7 +502,7 @@ mymain(void)
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
if (!mkdtemp(fakerootdir)) {
if (!g_mkdtemp(fakerootdir)) {
fprintf(stderr, "Cannot create fakerootdir");
abort();
}

View 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;

View 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();
}

View 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");