Fix compile on Linux.
authorRoy Marples <roy@marples.name>
Wed, 15 Apr 2009 16:33:06 +0000 (16:33 +0000)
committerRoy Marples <roy@marples.name>
Wed, 15 Apr 2009 16:33:06 +0000 (16:33 +0000)
mk/sys.mk
src/libdhcpcd/dispatch.c
src/libdhcpcd/libdhcpcd.h
src/libdhcpcd/misc.c
src/libdhcpcd/wpa.c

index b6605121404f6c12fead4c867b6a955a8af55b41..73f189ec3535e4af6e7d0c5fbe13e6ccaa55e3c9 100644 (file)
--- a/mk/sys.mk
+++ b/mk/sys.mk
@@ -14,6 +14,8 @@ INSTALL?=     install
 RANLIB?=       ranlib
 SED?=          sed
 
 RANLIB?=       ranlib
 SED?=          sed
 
+PICFLAG?=              -fPIC
+
 _LIBNAME_SH=           case `readlink /lib` in "") echo "lib";; *) basename `readlink /lib`;; esac
 _LIBNAME!=             ${_LIBNAME_SH}
 LIBNAME?=              ${_LIBNAME}$(shell ${_LIBNAME_SH})
 _LIBNAME_SH=           case `readlink /lib` in "") echo "lib";; *) basename `readlink /lib`;; esac
 _LIBNAME!=             ${_LIBNAME_SH}
 LIBNAME?=              ${_LIBNAME}$(shell ${_LIBNAME_SH})
index f1b90de4aa5f0efabac40d5a32c514999c6fe26e..c36f29712fc03945b82f866f6b23dffbf111b315 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include <stdlib.h>
  */
 
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 
 #define IN_LIBDHCPCD
 #include "libdhcpcd.h"
 
 #define IN_LIBDHCPCD
 #include "libdhcpcd.h"
index 6f955bcc418e1b72ad4e5abe2249bb9d3c9af3cc..323b9938d7127f3ff6b93e4409a92bceea9cc69d 100644 (file)
@@ -98,6 +98,10 @@ extern DHCPCD_WATCH *dhcpcd_watching;
 #define DHCPCD_SERVICE "name.marples.roy.dhcpcd"
 #define DHCPCD_PATH    "/name/marples/roy/dhcpcd"
 
 #define DHCPCD_SERVICE "name.marples.roy.dhcpcd"
 #define DHCPCD_PATH    "/name/marples/roy/dhcpcd"
 
+#ifdef __GLIBC__
+#  define strlcpy(dst, src, n) snprintf(dst, n, "%s", src)
+#endif
+
 bool dhcpcd_iter_get(DHCPCD_CONNECTION *, DHCPCD_MESSAGEITER *, int, void *);
 DHCPCD_MESSAGE * dhcpcd_send_reply(DHCPCD_CONNECTION *, DHCPCD_MESSAGE *);
 DHCPCD_MESSAGE * dhcpcd_message_reply(DHCPCD_CONNECTION *,
 bool dhcpcd_iter_get(DHCPCD_CONNECTION *, DHCPCD_MESSAGEITER *, int, void *);
 DHCPCD_MESSAGE * dhcpcd_send_reply(DHCPCD_CONNECTION *, DHCPCD_MESSAGE *);
 DHCPCD_MESSAGE * dhcpcd_message_reply(DHCPCD_CONNECTION *,
@@ -111,8 +115,6 @@ bool dhcpcd_dispatch_message(DHCPCD_CONNECTION *, DHCPCD_MESSAGE *);
 typedef void * DHCPCD_CONNECTION;
 #endif
 
 typedef void * DHCPCD_CONNECTION;
 #endif
 
-#define DHCPCD_CALLBACK void (*callback)(DHCPCD_CONNECTION *, void *, void *)
-
 DHCPCD_CONNECTION * dhcpcd_open(char **);
 bool dhcpcd_close(DHCPCD_CONNECTION *);
 const char * dhcpcd_error(DHCPCD_CONNECTION *);
 DHCPCD_CONNECTION * dhcpcd_open(char **);
 bool dhcpcd_close(DHCPCD_CONNECTION *);
 const char * dhcpcd_error(DHCPCD_CONNECTION *);
index 0037d8f4aac56a1da673d618e49f79c471a1378a..7d3d9c07ac6f9ca400ae7d7ff7c49209d088c51d 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 
 #include <libintl.h>
 
 
 #include <libintl.h>
 
index 0e287b0d18526e88a3cb6696255fd6f75626d394..73a6acf0517930293b28d35df2f00abf5319d853 100644 (file)
@@ -27,7 +27,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <strings.h>
+#include <string.h>
 
 #define IN_LIBDHCPCD
 #include "libdhcpcd.h"
 
 #define IN_LIBDHCPCD
 #include "libdhcpcd.h"