This patch is made against r6xx-r7xx-support but works against master
too. 2.6.29 now has current_euid, changed into using that, added legacy
support for old kernels. (as in, pulled the macro that defines that
from kernel tree)

Signed-off-by: Seppo Yli-Olli <seppo.yli-o...@iki.fi>
---
 linux-core/drm_compat.c |    4 ++++
 linux-core/drm_fops.c   |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index c4ebc2f..6b103af 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -75,6 +75,10 @@ pgprot_t vm_get_page_prot(unsigned long vm_flags)
 };
 #endif

+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
+#define current_euid()             (current_cred_xxx(euid))
+#endif
+

 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))

diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index ec52110..837645a 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -250,7 +250,7 @@ static int drm_open_helper(struct inode *inode,
struct file *filp, memset(priv, 0, sizeof(*priv));
        filp->private_data = priv;
        priv->filp = filp;
-       priv->uid = current->euid;
+       priv->uid = current_euid();
        priv->pid = current->pid;
        priv->minor = idr_find(&drm_minors_idr, minor_id);
        priv->ioctl_count = 0;
-- 
1.5.6.3

-- 
Seppo Yli-Olli <seppo.yli-o...@iki.fi>
"Understanding is a three-edged sword" - Kosh, Babylon 5

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to