[git commit] Fix mknod compilation on the FreeBSD

Denys Vlasenko vda.linux at googlemail.com
Mon Jan 4 12:28:28 UTC 2021


commit: https://git.busybox.net/busybox/commit/?id=28759d0e95cff70df9e4db319e0bcf310fbe7197
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

<sys/sysmacros.h> is linux-only
FreeBSD defines makedev in sys/types.h already included in the libbb.h.

Signed-off-by: Alex Samorukov <samm at os2.kiev.ua>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/mknod.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index eee0ac71d..b10fe4fc3 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -36,7 +36,9 @@
 //usage:       "$ mknod /dev/fd0 b 2 0\n"
 //usage:       "$ mknod -m 644 /tmp/pipe p\n"
 
-#include <sys/sysmacros.h>  // For makedev
+#ifdef __linux__
+# include <sys/sysmacros.h>  // For makedev
+#endif
 
 #include "libbb.h"
 #include "libcoreutils/coreutils.h"


More information about the busybox-cvs mailing list