[PULL,6/7] memfd: set up correct errno if not supported
diff mbox series

Message ID 20190312005930.9043-7-ehabkost@redhat.com
State New
Headers show
  • [PULL,1/7] hostmem-file: reject invalid pmem file sizes
Related show

Commit Message

Eduardo Habkost March 12, 2019, 12:59 a.m. UTC
From: Ilya Maximets <i.maximets@samsung.com>

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 | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

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);
+    errno = ENOSYS;
     return -1;