mirror of https://github.com/xemu-project/xemu.git
memfd: always check for MFD_CLOEXEC
QEMU always sets this flag unconditionally. We need to check if it's supported. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20190311135850.6537-3-i.maximets@samsung.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
4a66c7a999
commit
92db922f66
|
@ -188,7 +188,7 @@ bool qemu_memfd_alloc_check(void)
|
||||||
bool qemu_memfd_check(unsigned int flags)
|
bool qemu_memfd_check(unsigned int flags)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_LINUX
|
#ifdef CONFIG_LINUX
|
||||||
int mfd = memfd_create("test", flags);
|
int mfd = memfd_create("test", flags | MFD_CLOEXEC);
|
||||||
|
|
||||||
if (mfd >= 0) {
|
if (mfd >= 0) {
|
||||||
close(mfd);
|
close(mfd);
|
||||||
|
|
Loading…
Reference in New Issue