drm_hwcomposer: Improve error messages.
- Don't negate errno before passing to strerror, at least on
bionic this results in "Unknown error -x" instead of the actual
error.
- Fix another error message to print strerror(errno) instead of the
returned fd which will always be -1.
- Fix another error message to call strerror for consistency.
Signed-off-by: Peter Collingbourne <pcc@google.com>
diff --git a/drm/drmdevice.cpp b/drm/drmdevice.cpp
index bcb9ddd..bef41d8 100644
--- a/drm/drmdevice.cpp
+++ b/drm/drmdevice.cpp
@@ -126,7 +126,7 @@
/* TODO: Use drmOpenControl here instead */
fd_.Set(open(path, O_RDWR));
if (fd() < 0) {
- ALOGE("Failed to open dri- %s", strerror(-errno));
+ ALOGE("Failed to open dri %s: %s", path, strerror(errno));
return std::make_tuple(-ENODEV, 0);
}