[hackers] [smdev][PATCH] Include sys/sysmacros.h in smdev.c when major is not defined in sys/types.h

From: Firas Khalil Khana <firasuke_AT_gmail.com>
Date: Tue, 7 Jan 2020 18:52:16 +0200

This patch fixes the following build/link error with musl version 1.1.24:

LD smdev
/toolchain/lib/gcc/x86_64-pc-linux-musl/9.2.0/../../../../x86_64-pc-linux-musl/bin/ld: smdev.o: in function `createdev':
smdev.c:(.text+0xa11): undefined reference to `makedev'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:43: smdev] Error 1
make[1]: Leaving directory '/temporary/system/sources/smdev'
make: *** [Makefile:31: binlib] Error 2

---
 smdev.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/smdev.c b/smdev.c
index b774908..c5b0dde 100644
--- a/smdev.c
+++ b/smdev.c
_AT_@ -2,6 +2,9 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#ifndef major
+#include <sys/sysmacros.h>
+#endif
 
 #include <linux/sockios.h>
 #include <linux/if_packet.h>
-- 
2.24.1
Received on Tue Jan 07 2020 - 17:52:16 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 07 2020 - 18:24:24 CET