From: Lionel Landwerlin Date: Wed, 25 Sep 2019 13:26:52 +0000 (+0300) Subject: anv: gem-stubs: return a valid fd got anv_gem_userptr() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da2d67fc3b04128f3dad08c1002b260841312420;p=mesa.git anv: gem-stubs: return a valid fd got anv_gem_userptr() Fixes invalid close(-1) in the unit tests. Signed-off-by: Lionel Landwerlin Cc: Reviewed-by: Jason Ekstrand --- diff --git a/src/intel/vulkan/anv_gem_stubs.c b/src/intel/vulkan/anv_gem_stubs.c index 2c27ce26f37..bc9d7e066ba 100644 --- a/src/intel/vulkan/anv_gem_stubs.c +++ b/src/intel/vulkan/anv_gem_stubs.c @@ -68,7 +68,13 @@ anv_gem_munmap(void *p, uint64_t size) uint32_t anv_gem_userptr(struct anv_device *device, void *mem, size_t size) { - return -1; + int fd = os_create_anonymous_file(size, "fake bo"); + if (fd == -1) + return 0; + + assert(fd != 0); + + return fd; } int