>From f20a4ea99e79cd0155a56112c272c228dac463f8 Mon Sep 17 00:00:00 2001
From: Pauli Nieminen <suok...@gmail.com>
Date: Mon, 20 Jul 2009 15:34:13 +0300
Subject: [PATCH 04/15] libdrm: Fix unsigned/signed coparision of -1 value

gid_t is unsigned in gnu libc this makes it impossible to check if
group id is set to negative by xserver.
---
 libdrm/xf86drm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index a942233..d168258 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -340,7 +340,8 @@ static int drmOpenDevice(long dev, int minor, int type)
        drm_server_info->get_perms(&serv_group, &serv_mode);
        devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
        devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
-       group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
+       /* gid_t is unsigned so we have to check that value isn't equal to "-1" 
*/
+       group = (serv_group != (gid_t)-1) ? serv_group : DRM_DEV_GID;
     }

 #if !defined(UDEV)
-- 
1.6.3.3

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to