[stgt] [PATCH 06/14] tgt: BSD builds support

Boaz Harrosh bharrosh at panasas.com
Mon Feb 23 19:01:24 CET 2009


BSD's networking headers are very broken and do
weird stuff when included in the wrong order.
The changes are OK with Linux and enable BSD build.

Signed-off-by: Boaz Harrosh <bharrosh at panasas.com>
---
 usr/iscsi/iscsi_tcp.c |   15 ++++++++++-----
 usr/iscsi/isns.c      |   12 ++++++++----
 usr/iscsi/target.c    |    2 +-
 usr/libcrc32c.c       |    2 +-
 usr/scsi.c            |    2 +-
 usr/target.c          |    2 ++
 usr/tgtadm.c          |    2 ++
 usr/util.c            |    1 -
 8 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/usr/iscsi/iscsi_tcp.c b/usr/iscsi/iscsi_tcp.c
index edc4e86..bee2145 100644
--- a/usr/iscsi/iscsi_tcp.c
+++ b/usr/iscsi/iscsi_tcp.c
@@ -20,17 +20,22 @@
  * 02110-1301 USA
  */
 #include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
-#include <arpa/inet.h>
+
+#include <netdb.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+
 #include <sys/epoll.h>
-#include <sys/socket.h>
+#include <fcntl.h>
+#include <unistd.h>
 
 #include "iscsid.h"
 #include "tgtd.h"
diff --git a/usr/iscsi/isns.c b/usr/iscsi/isns.c
index 88e5211..ba0058f 100644
--- a/usr/iscsi/isns.c
+++ b/usr/iscsi/isns.c
@@ -20,16 +20,20 @@
  */
 
 #include <errno.h>
-#include <netdb.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
+
+#include <netdb.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
-#include <sys/socket.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+
 #include <sys/epoll.h>
-#include <sys/types.h>
 
 #include "iscsid.h"
 #include "parser.h"
diff --git a/usr/iscsi/target.c b/usr/iscsi/target.c
index 43b249f..ae531f1 100644
--- a/usr/iscsi/target.c
+++ b/usr/iscsi/target.c
@@ -26,9 +26,9 @@
 #include <netdb.h>
 #include <sys/stat.h>
 #include <sys/un.h>
+#include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>
diff --git a/usr/libcrc32c.c b/usr/libcrc32c.c
index bda0020..66301d5 100644
--- a/usr/libcrc32c.c
+++ b/usr/libcrc32c.c
@@ -31,7 +31,7 @@
  *
  */
 #include "crc32c.h"
-#include <asm/byteorder.h>
+#include "util.h"
 
 /*
  * MODULE_AUTHOR("Clay Haapala <chaapala at cisco.com>");
diff --git a/usr/scsi.c b/usr/scsi.c
index daf4aef..54672e8 100644
--- a/usr/scsi.c
+++ b/usr/scsi.c
@@ -26,7 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
-#include <syscall.h>
+#include <sys/syscall.h>
 #include <unistd.h>
 #include <linux/fs.h>
 
diff --git a/usr/target.c b/usr/target.c
index 0c293d5..7537153 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -28,6 +28,8 @@
 #include <unistd.h>
 #include <sys/socket.h>
 
+#include <linux/fs.h>
+
 #include "list.h"
 #include "util.h"
 #include "tgtd.h"
diff --git a/usr/tgtadm.c b/usr/tgtadm.c
index 9a60215..4737283 100644
--- a/usr/tgtadm.c
+++ b/usr/tgtadm.c
@@ -36,6 +36,8 @@
 #include <sys/types.h>
 #include <sys/un.h>
 
+#include <linux/fs.h>
+
 #include "scsi.h"
 #include "util.h"
 #include "list.h"
diff --git a/usr/util.c b/usr/util.c
index e91453d..2f4f488 100644
--- a/usr/util.c
+++ b/usr/util.c
@@ -29,7 +29,6 @@
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <linux/fs.h>
-#include <sys/sysmacros.h>
 
 #include "log.h"
 #include "util.h"
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list