mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-09 10:56:14 +00:00
Merge pull request #2261 from brauner/2018-04-06/thmo_patch_1
Fix temp file creation
This commit is contained in:
commit
5eda487c1c
@ -2286,9 +2286,12 @@ FILE *make_anonymous_mount_file(struct lxc_list *mount)
|
|||||||
|
|
||||||
fd = memfd_create(".lxc_mount_file", MFD_CLOEXEC);
|
fd = memfd_create(".lxc_mount_file", MFD_CLOEXEC);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
char template[] = P_tmpdir "/.lxc_mount_file_XXXXXX";
|
||||||
|
|
||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
return NULL;
|
return NULL;
|
||||||
fd = lxc_make_tmpfile((char *){P_tmpdir "/.lxc_mount_file"}, true);
|
|
||||||
|
fd = lxc_make_tmpfile(template, true);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
SYSERROR("Could not create temporary mount file");
|
SYSERROR("Could not create temporary mount file");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -52,10 +52,12 @@ int lxc_ringbuf_create(struct lxc_ringbuf *buf, size_t size)
|
|||||||
|
|
||||||
memfd = memfd_create(".lxc_ringbuf", MFD_CLOEXEC);
|
memfd = memfd_create(".lxc_ringbuf", MFD_CLOEXEC);
|
||||||
if (memfd < 0) {
|
if (memfd < 0) {
|
||||||
|
char template[] = P_tmpdir "/.lxc_ringbuf_XXXXXX";
|
||||||
|
|
||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
memfd = lxc_make_tmpfile((char *){P_tmpdir"/.lxc_ringbuf_XXXXXX"}, true);
|
memfd = lxc_make_tmpfile(template, true);
|
||||||
}
|
}
|
||||||
if (memfd < 0)
|
if (memfd < 0)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user