From acd7536857589b44814463078787ebe32cc2e519 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 6 May 2014 13:48:58 +0200
Subject: Small build fixes for Haiku.


diff --git a/LibLink/lib/llparsocket.c b/LibLink/lib/llparsocket.c
index 6d09d1f..7f723c2 100644
--- a/LibLink/lib/llparsocket.c
+++ b/LibLink/lib/llparsocket.c
@@ -21,6 +21,8 @@
 #include "llparsocket.h"
 #include "llspacket.h"
 
+#include <errno.h>
+
 #ifdef HAVE_WINSOCK_H
 #define AGAIN (WSAGetLastError() == WSAEWOULDBLOCK)
 #else
diff --git a/cpmredir/lib/cpmdrv.c b/cpmredir/lib/cpmdrv.c
index 79a872d..fd0511a 100644
--- a/cpmredir/lib/cpmdrv.c
+++ b/cpmredir/lib/cpmdrv.c
@@ -22,6 +22,8 @@
 
 #include "cpmint.h"
 
+#include <sys/statvfs.h>
+
 cpm_byte fcb_reset(void)
 {
 #ifdef __MSDOS__
@@ -131,11 +133,11 @@ cpm_word fcb_getdpb(cpm_byte *dpb)
 #ifndef WIN32
 /* XXX In WIN32, use some function or other to do this */
 
-        struct statfs buf;
+        struct statvfs buf;
 	cpm_word nfiles;
 
 	/* Get DPB for redir_cpmdrive. Currently just returns a dummy. */
-        if (!statfs(redir_drive_prefix[redir_cpmdrive], &buf))
+        if (!statvfs(redir_drive_prefix[redir_cpmdrive], &buf))
 	{
 		/* Store correct directory entry count */
 
@@ -184,12 +186,12 @@ cpm_word fcb_dfree (cpm_byte drive, cpm_byte *dma)
 		dfree = 4194303L;
 	}
 #else
-	struct statfs buf;
+	struct statvfs buf;
 	long dfree;
 
 	if (!redir_drive_prefix[drive]) return 0x01FF;	/* Can't select */
 	
-	if (statfs(redir_drive_prefix[drive], &buf)) return 0x01FF;
+	if (statvfs(redir_drive_prefix[drive], &buf)) return 0x01FF;
 
 	dfree = (buf.f_bavail * (buf.f_bsize / 128));
 
-- 
1.8.3.4

