From dc360a46481111dfe0a83e2e9759e81d678a8d05 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 19 Aug 2017 12:20:29 +0200
Subject: Haiku doesn't have the functions major,minor and makedev


diff --git a/pjdfstest.c b/pjdfstest.c
index 7f76b1a..a5731d8 100644
--- a/pjdfstest.c
+++ b/pjdfstest.c
@@ -60,6 +60,13 @@ typedef	struct stat64	stat_t;
 typedef	struct stat	stat_t;
 #endif
 
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define	major(x) ((int)(0x00ff & ((x) >> 8)))
+#define	minor(x) ((int)(0xffff00ff & (x)))
+#define	makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
+
 #ifndef ALLPERMS
 #define	ALLPERMS	(S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
 #endif
-- 
2.7.0


From fb7032605b24f9fd0200e6264aed58bd6b74ee92 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 19 Aug 2017 13:24:06 +0200
Subject: add Haiku to the supported OS's


diff --git a/tests/conf b/tests/conf
index cf8fb8b..1b2fb81 100644
--- a/tests/conf
+++ b/tests/conf
@@ -42,6 +42,10 @@ Solaris|SunOS)
 	fs=`mount -v | ${GREP} -E "^${pattern}" | awk '{print $5}' | \
 	    tr -s '[:lower:]' '[:upper:]'`
 	;;
+Haiku)
+	GREP=grep
+	fs=`df -b | tail -1 | awk '{print toupper($2)}'`
+	;;
 Linux)
 	GREP=grep
 	fs=`df -PT . | tail -1 | awk '{print toupper($2)}'`
-- 
2.7.0


From 86617c8a78fa146f766ae152a984481bb731b4c5 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 20 Aug 2017 07:13:07 +0200
Subject: add -lnetwork detection


diff --git a/configure.ac b/configure.ac
index df0b945..8f79445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,8 @@ AC_CHECK_HEADERS([ \
     sys/mkdev.h \
 ])
 
+AC_SEARCH_LIBS(socket, network)
+
 #HAS_FREEBSD_ACL
 
 AC_CHECK_FUNC([bindat],
-- 
2.7.0

