summaryrefslogtreecommitdiff
path: root/tests/drmtest.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-09-26 16:03:20 +0100
committerDave Airlie <airlied@redhat.com>2011-09-26 16:03:20 +0100
commitc82ef03e4c92017bf5644f294ea04e30500f8d4c (patch)
tree7888f3c46c310270a783e254190a94c4a08585fc /tests/drmtest.c
parent3a551c127439b2d5cad5c7ca817feab1ca4c78c5 (diff)
drmtest: make check should fail so hard on unable to open device
Diffstat (limited to 'tests/drmtest.c')
-rw-r--r--tests/drmtest.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/drmtest.c b/tests/drmtest.c
index a685102d..022994a0 100644
--- a/tests/drmtest.c
+++ b/tests/drmtest.c
@@ -62,7 +62,7 @@ int drm_open_matching(const char *pci_glob, int flags)
struct udev_device *device, *parent;
struct udev_list_entry *entry;
const char *pci_id, *path;
- const char *usub;
+ const char *usub, *dnode;
int fd;
udev = udev_new();
@@ -86,7 +86,10 @@ int drm_open_matching(const char *pci_glob, int flags)
pci_id = udev_device_get_property_value(parent, "PCI_ID");
if (fnmatch(pci_glob, pci_id, 0) != 0)
continue;
- fd = open(udev_device_get_devnode(device), O_RDWR);
+ dnode = udev_device_get_devnode(device);
+ if (strstr(dnode, "control"))
+ continue;
+ fd = open(dnode, O_RDWR);
if (fd < 0)
continue;
if ((flags & DRM_TEST_MASTER) && !is_master(fd)) {
@@ -109,7 +112,7 @@ int drm_open_any(void)
if (fd < 0) {
fprintf(stderr, "failed to open any drm device\n");
- abort();
+ exit(0);
}
return fd;
@@ -124,7 +127,7 @@ int drm_open_any_master(void)
if (fd < 0) {
fprintf(stderr, "failed to open any drm device\n");
- abort();
+ exit(0);
}
return fd;