Anyone aware of what this will break? It seems to be a much nicer thing
to do for callers. If people do not like it, I will probably just create
a #define drmIoctl2 or some such thing.

Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
Cc: Keith Packard <kei...@keithp.com>
Signed-off-by: Ben Widawsky <b...@bwidawsk.net>
---
 xf86drm.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xf86drm.c b/xf86drm.c
index 6ea068f..015203d 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -166,6 +166,10 @@ drmIoctl(int fd, unsigned long request, void *arg)
     do {
        ret = ioctl(fd, request, arg);
     } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+
+    if (ret)
+       return -errno;
+
     return ret;
 }
 
-- 
1.7.10.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to