summaryrefslogtreecommitdiffstats
path: root/common.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-09 10:02:28 +0000
committerRoy Marples <roy@marples.name>2008-01-09 10:02:28 +0000
commit890fe1c5a47f270316fef8b419d8aac587e5cf92 (patch)
tree59cc4629c61acea15fe2c4f2e7ea7af2f92cff37 /common.c
parenta165b0a92af9103e7645120be472310ed397a4b3 (diff)
downloaddhcpcd-890fe1c5a47f270316fef8b419d8aac587e5cf92.tar.xz
common.h now defines a simple define to create the function in common.c. NetBSD needs srandomdev also.
Diffstat (limited to 'common.c')
-rw-r--r--common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/common.c b/common.c
index 78f9694d..e07b26f0 100644
--- a/common.c
+++ b/common.c
@@ -71,7 +71,7 @@ char *getline (FILE *fp)
/* OK, this should be in dhcpcd.c
* It's here to make dhcpcd more readable */
-#ifdef __linux__
+#ifndef HAVE_SRANDOMDEV
void srandomdev (void)
{
int fd;
@@ -91,8 +91,7 @@ void srandomdev (void)
#endif
/* strlcpy is nice, shame glibc does not define it */
-#ifdef __GLIBC__
-# if ! defined (__UCLIBC__) && ! defined (__dietlibc__)
+#ifndef HAVE_STRLCPY
size_t strlcpy (char *dst, const char *src, size_t size)
{
const char *s = src;
@@ -112,7 +111,6 @@ size_t strlcpy (char *dst, const char *src, size_t size)
return (src - s - 1);
}
-# endif
#endif
/* Close our fd's */