mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
virsh: Add .xml suffix to tmp files used in *edit commands
This helps editors with detecting the temporary files as XML since the temporary files do not contain <?xml ...?> declaration. Requested by https://bugzilla.redhat.com/show_bug.cgi?id=602277
This commit is contained in:
parent
b0ef5c5367
commit
fb76151c28
@ -42,6 +42,7 @@ inet_pton
|
|||||||
ioctl
|
ioctl
|
||||||
maintainer-makefile
|
maintainer-makefile
|
||||||
mkstemp
|
mkstemp
|
||||||
|
mkstemps
|
||||||
mktempd
|
mktempd
|
||||||
netdb
|
netdb
|
||||||
perror
|
perror
|
||||||
|
@ -8964,10 +8964,10 @@ editWriteToTempFile (vshControl *ctl, const char *doc)
|
|||||||
|
|
||||||
tmpdir = getenv ("TMPDIR");
|
tmpdir = getenv ("TMPDIR");
|
||||||
if (!tmpdir) tmpdir = "/tmp";
|
if (!tmpdir) tmpdir = "/tmp";
|
||||||
snprintf (ret, PATH_MAX, "%s/virshXXXXXX", tmpdir);
|
snprintf (ret, PATH_MAX, "%s/virshXXXXXX.xml", tmpdir);
|
||||||
fd = mkstemp (ret);
|
fd = mkstemps(ret, 4);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
vshError(ctl, _("mkstemp: failed to create temporary file: %s"),
|
vshError(ctl, _("mkstemps: failed to create temporary file: %s"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
VIR_FREE(ret);
|
VIR_FREE(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user