From: Ben Widawsky Subject: [PATCH 1/2] drm: drmIoctl return -errno on failure conditions Date: Wed, 6 Jun 2012 16:41:17 -0700 Message-ID: <1339026077-27937-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 3851A9E7B4 for ; Wed, 6 Jun 2012 16:43:17 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Daniel Vetter , Ben Widawsky List-Id: dri-devel@lists.freedesktop.org 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 Cc: Keith Packard Signed-off-by: Ben Widawsky --- 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