summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2019-03-11 16:58:49 +0300
committerEduardo Habkost <ehabkost@redhat.com>2019-03-11 17:17:00 -0300
commitdf20819328d6fa3cb9d4a259a58cebbee35cdd09 (patch)
tree0b6e78c35b97c50d7c2bc3cb752ed9601a968037 /util
parent92db922f66cde45bb216c36eb43b762429c96a74 (diff)
downloadqemu-df20819328d6fa3cb9d4a259a58cebbee35cdd09.zip
memfd: set up correct errno if not supported
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>
Diffstat (limited to 'util')
-rw-r--r--util/memfd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/memfd.c b/util/memfd.c
index d74ce4d793..393d23da96 100644
--- a/util/memfd.c
+++ b/util/memfd.c
@@ -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
}