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>
This commit is contained in:
Ilya Maximets 2019-03-11 16:58:49 +03:00 committed by Eduardo Habkost
parent 92db922f66
commit df20819328
1 changed files with 1 additions and 0 deletions

View 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
}