Mesa (master): radeon/winsys: fix get info ioctl error checking

Jerome Glisse glisse at kemper.freedesktop.org
Mon Jan 9 11:43:19 PST 2012


Module: Mesa
Branch: master
Commit: b82a2a848c2f614be6186f411bc366ebe2f189bc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b82a2a848c2f614be6186f411bc366ebe2f189bc

Author: Jerome Glisse <jglisse at redhat.com>
Date:   Mon Jan  9 14:59:56 2012 -0500

radeon/winsys: fix get info ioctl error checking

Signed-off-by: Jerome Glisse <jglisse at redhat.com>

---

 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index 442bd2a..f337411 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -138,9 +138,11 @@ static boolean radeon_get_drm_value(int fd, unsigned request,
     info.request = request;
 
     retval = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info));
-    if (retval && errname) {
-        fprintf(stderr, "radeon: Failed to get %s, error number %d\n",
-                errname, retval);
+    if (retval) {
+        if (errname) {
+            fprintf(stderr, "radeon: Failed to get %s, error number %d\n",
+                    errname, retval);
+        }
         return FALSE;
     }
     return TRUE;



More information about the mesa-commit mailing list