hdparm: fix compilation with musl 547/head
authorRichard Kunze <richard.kunze@web.de>
Sun, 16 Nov 2014 00:56:12 +0000 (01:56 +0100)
committerRichard Kunze <richard.kunze@web.de>
Sun, 16 Nov 2014 00:56:12 +0000 (01:56 +0100)
Signed-off-by: Richard Kunze <richard.kunze@web.de>
utils/hdparm/Makefile
utils/hdparm/patches/001-fix-includes.patch [new file with mode: 0644]

index 8fb7fae3cffaf69857144c7eeebd79544bb3264a..a2988f42e05480873857edd7a6d6972d3a6ae2f4 100644 (file)
@@ -19,6 +19,8 @@ PKG_LICENSE:=BSD-Style Open Source License
 
 include $(INCLUDE_DIR)/package.mk
 
+TARGET_CFLAGS+=-D_GNU_SOURCE
+
 define Package/hdparm
   SECTION:=utils
   CATEGORY:=Utilities
diff --git a/utils/hdparm/patches/001-fix-includes.patch b/utils/hdparm/patches/001-fix-includes.patch
new file mode 100644 (file)
index 0000000..44343fb
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/hdparm.h
++++ b/hdparm.h
+@@ -2,6 +2,7 @@
+ //#undef __KERNEL_STRICT_NAMES
+ #include <linux/types.h>
++#include <sys/types.h>
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x)
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <limits.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <linux/types.h>