Blob Blame History Raw
diff -urp netbsd-iscsi-20071205.orig/include/compat.h netbsd-iscsi-20071205/include/compat.h
--- netbsd-iscsi-20071205.orig/include/compat.h	2006-05-26 18:34:43.000000000 +0200
+++ netbsd-iscsi-20071205/include/compat.h	2007-12-05 14:52:06.000000000 +0100
@@ -77,16 +77,20 @@ size_t strlcpy(char *, const char *, siz
  * A DCE 1.1 compatible source representation of UUIDs.
  */
 typedef struct uuid_t {
-        uint32_t        time_low;
-        uint16_t        time_mid;
-        uint16_t        time_hi_and_version;
-        uint8_t         clock_seq_hi_and_reserved;
-        uint8_t         clock_seq_low;
-        uint8_t         node[_UUID_NODE_LEN];
+        u_int32_t        time_low;
+        u_int16_t        time_mid;
+        u_int16_t        time_hi_and_version;
+        u_int8_t         clock_seq_hi_and_reserved;
+        u_int8_t         clock_seq_low;
+        u_int8_t         node[_UUID_NODE_LEN];
 } uuid_t;
 
-void    uuid_create(uuid_t *, uint32_t *);
-void    uuid_to_string(uuid_t *, char **, uint32_t *);
+void    uuid_create(uuid_t *, u_int32_t *);
+void    uuid_to_string(uuid_t *, char **, u_int32_t *);
+#endif
+
+#ifndef INFTIM
+#define INFTIM -1
 #endif
 
 #endif /* COMPAT_H_ */
diff -urp netbsd-iscsi-20071205.orig/include/iscsiutil.h netbsd-iscsi-20071205/include/iscsiutil.h
--- netbsd-iscsi-20071205.orig/include/iscsiutil.h	2007-11-13 00:19:16.000000000 +0100
+++ netbsd-iscsi-20071205/include/iscsiutil.h	2007-12-05 14:42:55.000000000 +0100
@@ -162,9 +162,17 @@ void	iscsi_print_buffer(const char *, co
 #include <machine/endian.h>
 #endif
 
+#ifndef __BYTE_ORDER
 #define __BYTE_ORDER    _BYTE_ORDER
+#endif
+
+#ifndef __BIG_ENDIAN
 #define __BIG_ENDIAN    _BIG_ENDIAN
+#endif
+
+#ifndef __LITTLE_ENDIAN
 #define __LITTLE_ENDIAN _LITTLE_ENDIAN
+#endif
 
 #define ISCSI_NTOHLL(a)	ISCSI_BE64TOH(a)
 #define ISCSI_HTONLL(a)	ISCSI_HTOBE64(a)
diff -urp netbsd-iscsi-20071205.orig/src/conffile.c netbsd-iscsi-20071205/src/conffile.c
--- netbsd-iscsi-20071205.orig/src/conffile.c	2007-08-14 20:52:48.000000000 +0200
+++ netbsd-iscsi-20071205/src/conffile.c	2007-12-05 14:55:53.000000000 +0100
@@ -27,6 +27,8 @@
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#include "compat.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/stat.h>
diff -urp netbsd-iscsi-20071205.orig/src/iscsi-target.c netbsd-iscsi-20071205/src/iscsi-target.c
--- netbsd-iscsi-20071205.orig/src/iscsi-target.c	2007-11-13 00:25:41.000000000 +0100
+++ netbsd-iscsi-20071205/src/iscsi-target.c	2007-12-05 14:54:25.000000000 +0100
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "config.h"
+#include "compat.h"
 
 #define EXTERN
 
diff -urp netbsd-iscsi-20071205.orig/src/netmask.c netbsd-iscsi-20071205/src/netmask.c
--- netbsd-iscsi-20071205.orig/src/netmask.c	2007-11-13 00:25:42.000000000 +0100
+++ netbsd-iscsi-20071205/src/netmask.c	2007-12-05 14:54:49.000000000 +0100
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "config.h"
+#include "compat.h"
 
 #include <sys/types.h>
 #include <sys/param.h>
diff -urp netbsd-iscsi-20071205.orig/src/strlcpy.c netbsd-iscsi-20071205/src/strlcpy.c
--- netbsd-iscsi-20071205.orig/src/strlcpy.c	2006-03-28 00:26:28.000000000 +0200
+++ netbsd-iscsi-20071205/src/strlcpy.c	2007-12-05 15:01:22.000000000 +0100
@@ -1,5 +1,6 @@
 /*	$NetBSD: strlcpy.c,v 1.3 2006/03/27 22:26:28 agc Exp $	*/
 /*	$OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $	*/
+/*	$OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $	*/
 
 /*
  * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -65,4 +66,39 @@ strlcpy(dst, src, siz)
 
 	return(s - src - 1);	/* count does not include NUL */
 }
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left).  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+strlcat(char *dst, const char *src, size_t siz)
+{
+	char *d = dst;
+	const char *s = src;
+	size_t n = siz;
+	size_t dlen;
+
+	/* Find the end of dst and adjust bytes left but don't go past end */
+	while (n-- != 0 && *d != '\0')
+		d++;
+	dlen = d - dst;
+	n = siz - dlen;
+
+	if (n == 0)
+		return(dlen + strlen(s));
+	while (*s != '\0') {
+		if (n != 1) {
+			*d++ = *s;
+			n--;
+		}
+		s++;
+	}
+	*d = '\0';
+
+	return(dlen + (s - src));	/* count does not include NUL */
+}
 #endif
diff -urp netbsd-iscsi-20071205.orig/src/target.c netbsd-iscsi-20071205/src/target.c
--- netbsd-iscsi-20071205.orig/src/target.c	2007-10-26 20:26:18.000000000 +0200
+++ netbsd-iscsi-20071205/src/target.c	2007-12-05 14:45:43.000000000 +0100
@@ -81,6 +81,7 @@
 #endif
            
 
+#include "compat.h"
 #include "iscsi.h"
 #include "target.h"
 #include "device.h"