Skip to content

Commit

Permalink
media-libs/svgalib: fix bug 557052
Browse files Browse the repository at this point in the history
Add support for file_inode() appeared in 3.9.0.
In 4.0 f_dentry struct was removed, so this call is the only way
to go.

Patch is based on  Diego Moimas proposal from bug 557052.

Package-Manager: portage-2.2.27
Signed-off-by: Andrew Savchenko <[email protected]>
  • Loading branch information
bircoph committed Feb 22, 2016
1 parent 301007e commit d015d86
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions media-libs/svgalib/files/svgalib-1.9.25-linux3.9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- svgalib-1.9.25/kernel/svgalib_helper/main.c.orig 2016-02-22 11:10:25.000000000 +0300
+++ svgalib-1.9.25/kernel/svgalib_helper/main.c 2016-02-22 11:17:16.223529679 +0300
@@ -170,8 +170,12 @@
#else
static int svgalib_helper_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
+ struct inode *inode=file_inode(filp);
+#else
struct inode *inode=filp->f_dentry->d_inode;
#endif
+#endif

io_t iov, *user_iov=(io_t *)arg;
pcic_t pciv, *user_pciv=(pcic_t *)arg;
@@ -586,7 +590,11 @@
static int svgalib_helper_mmap(struct file *filp, struct vm_area_struct *vma) {
unsigned long start=vma->vm_start;
unsigned long end=vma->vm_end;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
+ unsigned long minor = my_minor(file_inode(filp)->i_rdev);
+#else
unsigned long minor = my_minor(filp->f_dentry->d_inode->i_rdev);
+#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
unsigned long ofs=vma->vm_pgoff*PAGE_SIZE;
#else
3 changes: 2 additions & 1 deletion media-libs/svgalib/svgalib-1.9.25-r4.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2012 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

Expand Down Expand Up @@ -37,6 +37,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-1.9.25-build2.patch
epatch "${FILESDIR}"/${PN}-1.9.25-qa.patch
epatch "${FILESDIR}"/${PN}-1.9.25-kernel3.4.patch
epatch "${FILESDIR}"/${PN}-1.9.25-linux3.9.patch
sed -i -e '/linux\/smp_lock.h/d' kernel/svgalib_helper/main.c || die
}

Expand Down

0 comments on commit d015d86

Please sign in to comment.