gbm: Log at least one dlerror() when we fail to open any drivers.
authorEric Anholt <eric@anholt.net>
Fri, 20 Jun 2014 13:10:29 +0000 (14:10 +0100)
committerEric Anholt <eric@anholt.net>
Thu, 31 Jul 2014 05:31:30 +0000 (22:31 -0700)
We don't want to log every single error (such as all the ones where the file
wasn't even present in our list of search paths), but if you didn't find any
driver, then seeing at least one error is useful (since the common case as a
developer is a single DEFAULT_DRIVER_DIR or GBM_DRIVERS_PATH entry).

v2: Rebase on swrast changes.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gbm/backends/dri/gbm_dri.c

index 0fbe81c..f637e32 100644 (file)
@@ -338,6 +338,7 @@ dri_open_driver(struct gbm_dri_device *dri)
    if (dri->driver == NULL) {
       fprintf(stderr, "gbm: failed to open any driver (search paths %s)\n",
               search_paths);
+      fprintf(stderr, "gbm: Last dlopen error: %s\n", dlerror());
       return NULL;
    }