lxc_make_tmpfile() uses mkstemp() internally, and thus expects the
template to contain 'XXXXXX' and be writable.
Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
memfd = memfd_create(".lxc_ringbuf", MFD_CLOEXEC);
if (memfd < 0) {
+ char template[] = P_tmpdir "/.lxc_ringbuf_XXXXXX";
+
if (errno != ENOSYS)
goto on_error;
- memfd = lxc_make_tmpfile((char *){P_tmpdir"/.lxc_ringbuf_XXXXXX"}, true);
+ memfd = lxc_make_tmpfile(template, true);
}
if (memfd < 0)
goto on_error;