]> git.proxmox.com Git - mirror_qemu.git/commitdiff
memfd: set up correct errno if not supported
authorIlya Maximets <i.maximets@samsung.com>
Mon, 11 Mar 2019 13:58:49 +0000 (16:58 +0300)
committerEduardo Habkost <ehabkost@redhat.com>
Mon, 11 Mar 2019 20:17:00 +0000 (17:17 -0300)
qemu_memfd_create() prints the value of 'errno' which is not
set in this case.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190311135850.6537-4-i.maximets@samsung.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
util/memfd.c

index d74ce4d793d019d5b8a335a9f535b085114c4171..393d23da96b2635d780f9ff4634dc6808b645dbd 100644 (file)
@@ -40,6 +40,7 @@ static int memfd_create(const char *name, unsigned int flags)
 #ifdef __NR_memfd_create
     return syscall(__NR_memfd_create, name, flags);
 #else
+    errno = ENOSYS;
     return -1;
 #endif
 }