mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +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);
|
||||
|
||||
if (!(proc->uniqDir = mkdtemp(template))) {
|
||||
if (!(proc->uniqDir = g_mkdtemp(template))) {
|
||||
virReportSystemError(errno,
|
||||
_("Failed to create unique directory with "
|
||||
"template '%s' for probing QEMU"),
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
fprintf(stderr, "Cannot create fakerootdir");
|
||||
abort();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
fprintf(stderr, "Cannot create fakerootdir");
|
||||
abort();
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -609,7 +609,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
fprintf(stderr, "Cannot create fakerootdir");
|
||||
abort();
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
fprintf(stderr, "Cannot create fakerootdir");
|
||||
abort();
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
fprintf(stderr, "Cannot create fakerootdir");
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
fprintf(stderr, "Cannot create fakerootdir");
|
||||
abort();
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -330,7 +330,7 @@ mymain(void)
|
||||
|
||||
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
|
||||
|
||||
if (!mkdtemp(fakerootdir)) {
|
||||
if (!g_mkdtemp(fakerootdir)) {
|
||||
VIR_TEST_DEBUG("Cannot create fakerootdir");
|
||||
abort();
|
||||
}
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user