From ef769e5e87d9b16125b0fb1e51fc8b90a91a3cb0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Fri, 28 Dec 2012 22:28:13 +0100
Subject: [PATCH] add declaration of sa_family_t in sys/socket.h

* added missing declaration of sa_family_t in sys/socket.h, this fixes #8731
  thanks to Anarchos for the patch.
* fixed the build of the command ftp
---
 headers/posix/sys/socket.h   | 5 +++--
 src/bin/network/ftp/extern.h | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/headers/posix/sys/socket.h b/headers/posix/sys/socket.h
index 0514d91dda..16547a8752 100644
--- a/headers/posix/sys/socket.h
+++ b/headers/posix/sys/socket.h
@@ -13,6 +13,7 @@
 
 
 typedef uint32_t socklen_t;
+typedef uint8_t sa_family_t;
 
 /* Address families */
 #define AF_UNSPEC		0
@@ -86,13 +87,13 @@ struct linger {
 
 struct sockaddr {
 	uint8_t		sa_len;
-	uint8_t		sa_family;
+	sa_family_t	sa_family;
 	uint8_t		sa_data[30];
 };
 
 struct sockaddr_storage {
 	uint8_t		ss_len;			/* total length */
-	uint8_t		ss_family;		/* address family */
+	sa_family_t	ss_family;		/* address family */
 	uint8_t		__ss_pad1[6];	/* align to quad */
 	uint64_t	__ss_pad2;		/* force alignment to 64 bit */
 	uint8_t		__ss_pad3[112];	/* pad to a total of 128 bytes */
diff --git a/src/bin/network/ftp/extern.h b/src/bin/network/ftp/extern.h
index 3070e9552e..9be2b20c6a 100644
--- a/src/bin/network/ftp/extern.h
+++ b/src/bin/network/ftp/extern.h
@@ -100,7 +100,9 @@ struct sockaddr;
 struct tm;
 struct addrinfo;
 
+#ifndef __HAIKU__
 typedef int sa_family_t;
+#endif
 
 void	abort_remote(FILE *);
 void	abort_squared(int);