diff -ruN --exclude=*.orig ../ipmitool-1.6.0/include/ipmitool/ipmi.h ./include/ipmitool/ipmi.h
--- ../ipmitool-1.6.0/include/ipmitool/ipmi.h	Sat Sep 11 03:11:59 2004
+++ ./include/ipmitool/ipmi.h	Sun Oct 31 12:25:57 2004
@@ -40,6 +40,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <inttypes.h>
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
 #include <netinet/in.h>
 #include <ipmitool/helper.h>
 
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/lib/ipmi_channel.c ./lib/ipmi_channel.c
--- ../ipmitool-1.6.0/lib/ipmi_channel.c	Fri Sep  3 04:30:40 2004
+++ ./lib/ipmi_channel.c	Sun Oct 31 12:25:57 2004
@@ -37,11 +37,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <signal.h>
 
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/lib/ipmi_event.c ./lib/ipmi_event.c
--- ../ipmitool-1.6.0/lib/ipmi_event.c	Fri Aug 27 23:51:57 2004
+++ ./lib/ipmi_event.c	Sun Oct 31 12:25:57 2004
@@ -37,11 +37,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <signal.h>
 
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/lib/ipmi_lanp.c ./lib/ipmi_lanp.c
--- ../ipmitool-1.6.0/lib/ipmi_lanp.c	Fri Sep  3 04:33:17 2004
+++ ./lib/ipmi_lanp.c	Sun Oct 31 12:25:57 2004
@@ -37,11 +37,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <signal.h>
 #include <setjmp.h>
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/lib/ipmi_session.c ./lib/ipmi_session.c
--- ../ipmitool-1.6.0/lib/ipmi_session.c	Thu Sep  2 02:27:28 2004
+++ ./lib/ipmi_session.c	Sun Oct 31 12:25:58 2004
@@ -37,11 +37,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <signal.h>
 
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/lib/ipmi_sol.c ./lib/ipmi_sol.c
--- ../ipmitool-1.6.0/lib/ipmi_sol.c	Wed Sep  1 06:52:57 2004
+++ ./lib/ipmi_sol.c	Sun Oct 31 12:25:58 2004
@@ -37,9 +37,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <sys/types.h>
 #include <sys/select.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <signal.h>
 #include <unistd.h>
 
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/lib/ipmi_user.c ./lib/ipmi_user.c
--- ../ipmitool-1.6.0/lib/ipmi_user.c	Wed Sep  1 06:52:57 2004
+++ ./lib/ipmi_user.c	Sun Oct 31 12:25:58 2004
@@ -37,9 +37,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <sys/types.h>
 #include <sys/select.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <signal.h>
 #include <unistd.h>
 
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/src/ipmievd.c ./src/ipmievd.c
--- ../ipmitool-1.6.0/src/ipmievd.c	Wed Sep  1 06:52:57 2004
+++ ./src/ipmievd.c	Sun Oct 31 12:25:58 2004
@@ -45,6 +45,10 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/poll.h>
+#ifdef __FreeBSD__
+#include <signal.h>
+#include <paths.h>
+#endif
 
 #include <config.h>
 
@@ -79,7 +83,7 @@
 #ifdef SIGHUP
 	sigemptyset(&sighup);
 	sigaddset(&sighup, SIGHUP);
-	if (sigprocmask(SIG_UNBLOCK, &sighup, nil) < 0)
+	if (sigprocmask(SIG_UNBLOCK, &sighup, NULL) < 0)
 		fprintf(stderr, "ERROR: could not unblock SIGHUP signal\n");
 	SIG_IGNORE(SIGHUP);
 #endif
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/src/ipmishell.c ./src/ipmishell.c
--- ../ipmitool-1.6.0/src/ipmishell.c	Sat Sep 11 01:42:24 2004
+++ ./src/ipmishell.c	Sun Oct 31 12:38:23 2004
@@ -81,7 +81,12 @@
 		return -1;
 	if (!shell_intf->keepalive)
 		return 0;
+#if	defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402
 	if (internal_timer++ < RL_TIMEOUT)
+#else
+	/* In readline < 4.2 keyboard timeout hardcoded to 0.1 second. */
+	if (internal_timer++ < RL_TIMEOUT * 10)
+#endif
 		return 0;
 
 	internal_timer = 0;
@@ -106,8 +111,10 @@
 		/* hook to keep lan sessions active */
 		shell_intf = intf;
 		rl_event_hook = rl_event_keepalive;
+#if	defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402
 		/* set to 1 second */
 		rl_set_keyboard_input_timeout(1000*1000);
+#endif
 	}
 
 	while ((pbuf = (char *)readline(RL_PROMPT)) != NULL) {
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/src/plugins/lan/lan.c ./src/plugins/lan/lan.c
--- ../ipmitool-1.6.0/src/plugins/lan/lan.c	Sat Sep 11 03:12:33 2004
+++ ./src/plugins/lan/lan.c	Sun Oct 31 12:25:58 2004
@@ -38,11 +38,11 @@
 #include <stdio.h>
 #include <inttypes.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <signal.h>
 #include <setjmp.h>
diff -ruN --exclude=*.orig ../ipmitool-1.6.0/src/plugins/lanplus/lanplus.c ./src/plugins/lanplus/lanplus.c
--- ../ipmitool-1.6.0/src/plugins/lanplus/lanplus.c	Sat Sep 11 03:12:44 2004
+++ ./src/plugins/lanplus/lanplus.c	Sun Oct 31 12:25:58 2004
@@ -38,11 +38,11 @@
 #include <stdio.h>
 #include <inttypes.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
-#include <sys/types.h>
 #include <unistd.h>
 #include <signal.h>
 #include <setjmp.h>
