diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2016-07-13 10:01:34 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-07-20 23:44:40 +0100 |
commit | 681fd2ab6da0627ac8b8838eed4b3878c1cb8d25 (patch) | |
tree | 9d57d438e409def4ec2357eed75ae7c48dbf3a85 /tests | |
parent | dd58044530ab57b8c2ee0a56008bc97bd1eecdd9 (diff) | |
download | libdrm-681fd2ab6da0627ac8b8838eed4b3878c1cb8d25.tar.gz libdrm-681fd2ab6da0627ac8b8838eed4b3878c1cb8d25.tar.bz2 libdrm-681fd2ab6da0627ac8b8838eed4b3878c1cb8d25.zip |
tests/drmdevice: be move verbose when using open()
Print out the node we're attempting to open and a message if/why we fail
to do so.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/drmdevice.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/drmdevice.c b/tests/drmdevice.c index ac5f6ff8..72e70660 100644 --- a/tests/drmdevice.c +++ b/tests/drmdevice.c @@ -21,8 +21,10 @@ * */ +#include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> @@ -93,12 +95,15 @@ main(void) for (int j = 0; j < DRM_NODE_MAX; j++) { if (devices[i]->available_nodes & 1 << j) { + printf("Opening device %d node %s\n", i, devices[i]->nodes[j]); fd = open(devices[i]->nodes[j], O_RDONLY | O_CLOEXEC, 0); - if (fd < 0) + if (fd < 0) { + printf("Failed - %s (%d)\n", strerror(errno), errno); continue; + } if (drmGetDevice(fd, &device) == 0) { - print_device_info(device, -1); + print_device_info(device, i); drmFreeDevice(&device); } close(fd); |