mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
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:
parent
4ac4773040
commit
ef88698668
@ -8447,7 +8447,7 @@ qemuProcessQMPInit(qemuProcessQMPPtr proc)
|
|||||||
|
|
||||||
template = g_strdup_printf("%s/qmp-XXXXXX", proc->libDir);
|
template = g_strdup_printf("%s/qmp-XXXXXX", proc->libDir);
|
||||||
|
|
||||||
if (!(proc->uniqDir = mkdtemp(template))) {
|
if (!(proc->uniqDir = g_mkdtemp(template))) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("Failed to create unique directory with "
|
_("Failed to create unique directory with "
|
||||||
"template '%s' for probing QEMU"),
|
"template '%s' for probing QEMU"),
|
||||||
|
@ -319,7 +319,7 @@ mymain(void)
|
|||||||
char scratchdir[] = SCRATCHDIRTEMPLATE;
|
char scratchdir[] = SCRATCHDIRTEMPLATE;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!mkdtemp(scratchdir)) {
|
if (!g_mkdtemp(scratchdir)) {
|
||||||
virFilePrintf(stderr, "Cannot create fdstreamdir");
|
virFilePrintf(stderr, "Cannot create fdstreamdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1045,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
|
|||||||
|
|
||||||
tmpdir_template = g_strdup("/tmp/libvirt_XXXXXX");
|
tmpdir_template = g_strdup("/tmp/libvirt_XXXXXX");
|
||||||
|
|
||||||
if (!(test->tmpdir = mkdtemp(tmpdir_template))) {
|
if (!(test->tmpdir = g_mkdtemp(tmpdir_template))) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
"Failed to create temporary directory");
|
"Failed to create temporary directory");
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -609,7 +609,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -709,14 +709,14 @@ int qemuTestDriverInit(virQEMUDriver *driver)
|
|||||||
driver->config->libDir = g_strdup("/tmp/lib");
|
driver->config->libDir = g_strdup("/tmp/lib");
|
||||||
driver->config->channelTargetDir = g_strdup("/tmp/channel");
|
driver->config->channelTargetDir = g_strdup("/tmp/channel");
|
||||||
|
|
||||||
if (!mkdtemp(statedir)) {
|
if (!g_mkdtemp(statedir)) {
|
||||||
virFilePrintf(stderr, "Cannot create fake stateDir");
|
virFilePrintf(stderr, "Cannot create fake stateDir");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
driver->config->stateDir = g_strdup(statedir);
|
driver->config->stateDir = g_strdup(statedir);
|
||||||
|
|
||||||
if (!mkdtemp(configdir)) {
|
if (!g_mkdtemp(configdir)) {
|
||||||
virFilePrintf(stderr, "Cannot create fake configDir");
|
virFilePrintf(stderr, "Cannot create fake configDir");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -989,7 +989,7 @@ initFakeFS(const char *mode,
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
fprintf(stderr, "Cannot create fakerootdir");
|
fprintf(stderr, "Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ testSocketAccept(const void *opaque)
|
|||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
virNetSocketPtr usock;
|
virNetSocketPtr usock;
|
||||||
tmpdir = mkdtemp(template);
|
tmpdir = g_mkdtemp(template);
|
||||||
if (tmpdir == NULL) {
|
if (tmpdir == NULL) {
|
||||||
VIR_WARN("Failed to create temporary directory");
|
VIR_WARN("Failed to create temporary directory");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -315,7 +315,7 @@ static int testSocketUNIXAddrs(const void *data G_GNUC_UNUSED)
|
|||||||
char *tmpdir;
|
char *tmpdir;
|
||||||
char template[] = "/tmp/libvirt_XXXXXX";
|
char template[] = "/tmp/libvirt_XXXXXX";
|
||||||
|
|
||||||
tmpdir = mkdtemp(template);
|
tmpdir = g_mkdtemp(template);
|
||||||
if (tmpdir == NULL) {
|
if (tmpdir == NULL) {
|
||||||
VIR_WARN("Failed to create temporary directory");
|
VIR_WARN("Failed to create temporary directory");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -330,7 +330,7 @@ mymain(void)
|
|||||||
|
|
||||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||||
|
|
||||||
if (!mkdtemp(fakerootdir)) {
|
if (!g_mkdtemp(fakerootdir)) {
|
||||||
VIR_TEST_DEBUG("Cannot create fakerootdir");
|
VIR_TEST_DEBUG("Cannot create fakerootdir");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ mymain(void)
|
|||||||
|
|
||||||
virscsi_prefix = g_strdup_printf("%s" VIR_SCSI_DATA, abs_srcdir);
|
virscsi_prefix = g_strdup_printf("%s" VIR_SCSI_DATA, abs_srcdir);
|
||||||
|
|
||||||
tmpdir = mkdtemp(template);
|
tmpdir = g_mkdtemp(template);
|
||||||
|
|
||||||
if (tmpdir == NULL) {
|
if (tmpdir == NULL) {
|
||||||
VIR_WARN("Failed to create temporary directory");
|
VIR_WARN("Failed to create temporary directory");
|
||||||
|
Loading…
Reference in New Issue
Block a user