Make the failure message for drm_open_any() more specific
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 Jul 2013 09:02:27 +0000 (10:02 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 Jul 2013 09:01:15 +0000 (10:01 +0100)
Do not suggest retrying as root if we already are.

lib/drmtest.c

index 5edfda5..011d8c1 100644 (file)
@@ -266,7 +266,8 @@ int drm_open_any(void)
        int fd = __drm_open_any();
 
        if (fd < -1) {
-               fprintf(stderr, "failed to open any drm device. retry as root?\n");
+               fprintf(stderr, "Failed to open any drm device.%s\n",
+                       geteuid() ? "Retry as root?" : "");
                return fd;
        }