sys-fs/lsscsi: fix build w/newer glibc #580494
authorMike Frysinger <vapier@gentoo.org>
Tue, 19 Apr 2016 07:10:47 +0000 (03:10 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 19 Apr 2016 07:10:47 +0000 (03:10 -0400)
sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch [new file with mode: 0644]
sys-fs/lsscsi/lsscsi-0.28.ebuild

diff --git a/sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch b/sys-fs/lsscsi/files/lsscsi-0.28-sysmacros.patch
new file mode 100644 (file)
index 0000000..099256f
--- /dev/null
@@ -0,0 +1,37 @@
+https://bugs.gentoo.org/580494
+
+From 5f1d6f46c8c1ac134841cfcce22dc7639598e032 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 03:07:23 -0400
+Subject: [PATCH] include sys/sysmacros.h for major/minor
+
+These funcs are defined in sys/sysmacros.h, so include it to avoid:
+lsscsi.c: In function 'collect_dev_nodes':
+lsscsi.c:961:32: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
+                 cur_ent->maj = major(stats.st_rdev);
+                                ^
+lsscsi.c:962:32: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
+                 cur_ent->min = minor(stats.st_rdev);
+                                ^
+lsscsi.o: In function 'get_dev_node':
+lsscsi.c:(.text+0x10f0): undefined reference to 'major'
+lsscsi.c:(.text+0x1117): undefined reference to 'minor'
+---
+ src/lsscsi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lsscsi.c b/src/lsscsi.c
+index e494169..61cfebd 100644
+--- a/src/lsscsi.c
++++ b/src/lsscsi.c
+@@ -23,6 +23,7 @@
+ #include <unistd.h>
+ #include <getopt.h>
+ #include <fcntl.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <dirent.h>
+-- 
+2.7.4
+
index e3700959f087ad1ccf540a665e9c88ed623c4194..f11c94795ef7953bd0cf6809aac3735ecc003bdf 100644 (file)
@@ -4,6 +4,8 @@
 
 EAPI=5
 
+inherit eutils
+
 DESCRIPTION="SCSI sysfs query tool"
 HOMEPAGE="http://sg.danny.cz/scsi/lsscsi.html"
 SRC_URI="http://sg.danny.cz/scsi/${P}.tgz"
@@ -11,3 +13,7 @@ SRC_URI="http://sg.danny.cz/scsi/${P}.tgz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-sysmacros.patch #580494
+}