diff options
author | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2022-03-16 10:10:39 +0900 |
---|---|---|
committer | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2022-03-16 10:59:37 +0900 |
commit | a669947c687ba6dceb9c82aa87dff5f8d453273e (patch) | |
tree | 17b764a5ba2233631116609217f3a0996a785127 | |
parent | 93ae23dabbde590a1b61895d07d2ffa40c3d3e49 (diff) |
test/lease-manager: Create dummy fds for fake lease grants
drmModeCreateLease() should return a new lease fd for every succesful call.
Make sure that our dummy implementation does the same.
Returning 0 will cause stdout to be closed at the end of each test,
which will break the test logging when tests are run without forking
(ie. when CK_FORK=no)
Change-Id: I6b9436a962fb25b88576ae1c950c4f6f698e949a
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
-rw-r--r-- | drm-lease-manager/test/test-drm-device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drm-lease-manager/test/test-drm-device.c b/drm-lease-manager/test/test-drm-device.c index 844599a..c024d6e 100644 --- a/drm-lease-manager/test/test-drm-device.c +++ b/drm-lease-manager/test/test-drm-device.c @@ -17,6 +17,7 @@ #include <stdbool.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include <xf86drmMode.h> #include "test-drm-device.h" @@ -105,7 +106,6 @@ GET_DRM_RESOURCE_FN(Plane, plane, PLANE, plane_resources) int create_lease(int fd, const uint32_t *objects, int num_objects, int flags, uint32_t *lessee_id) { - UNUSED(fd); UNUSED(objects); UNUSED(num_objects); UNUSED(flags); @@ -118,5 +118,5 @@ int create_lease(int fd, const uint32_t *objects, int num_objects, int flags, test_device.leases.count++; - return 0; + return dup(fd); } |