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)
Bug-AGL: SPEC-3815
Change-Id: I6b9436a962fb25b88576ae1c950c4f6f698e949a
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <xf86drmMode.h>
#include "test-drm-device.h"
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);
test_device.leases.count++;
- return 0;
+ return dup(fd);
}