summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-10-28 14:12:54 +1000
committerDamien Miller <djm@mindrot.org>1999-10-28 14:12:54 +1000
commite413cba972feb60d3d4d104c0c93320435610d1b (patch)
treed712398819471c56f89ea3fc7a4fa5fb8db38690
parent062307657e30c9b970514eb53b4b743f9d571231 (diff)
Disabled code based on autoconf tests
-rw-r--r--helper.c16
-rw-r--r--helper.h7
-rw-r--r--mktemp.c5
-rw-r--r--mktemp.h4
-rw-r--r--rc4.c4
-rw-r--r--rc4.h5
-rw-r--r--strlcpy.c5
-rw-r--r--strlcpy.h5
8 files changed, 45 insertions, 6 deletions
diff --git a/helper.c b/helper.c
index c9aa51e4..6959535d 100644
--- a/helper.c
+++ b/helper.c
@@ -45,18 +45,15 @@
#include "rc4.h"
#include "xmalloc.h"
-
+#include "config.h"
#include "helper.h"
+#ifndef HAVE_ARC4RANDOM
+
void get_random_bytes(unsigned char *buf, int len);
static rc4_t *rc4 = NULL;
-void setproctitle(const char *fmt, ...)
-{
- /* FIXME */
-}
-
unsigned int arc4random(void)
{
unsigned int r;
@@ -105,4 +102,11 @@ void get_random_bytes(unsigned char *buf, int len)
exit(1);
}
}
+#endif /* !HAVE_ARC4RANDOM */
+#ifndef HAVE_SETPROCTITLE
+void setproctitle(const char *fmt, ...)
+{
+ /* FIXME */
+}
+#endif /* !HAVE_SETPROCTITLE */
diff --git a/helper.h b/helper.h
index 309156a2..0e53fac4 100644
--- a/helper.h
+++ b/helper.h
@@ -36,8 +36,15 @@
#ifndef _HELPER_H
#define _HELPER_H
+#include "config.h"
+
+#ifndef HAVE_ARC4RANDOM
unsigned int arc4random(void);
void arc4random_stir(void);
+#endif /* !HAVE_ARC4RANDOM */
+
+#ifndef HAVE_SETPROCTITLE
void setproctitle(const char *fmt, ...);
+#endif /* !HAVE_SETPROCTITLE */
#endif /* _HELPER_H */
diff --git a/mktemp.c b/mktemp.c
index 69dc4dc6..de11a6b5 100644
--- a/mktemp.c
+++ b/mktemp.c
@@ -47,8 +47,11 @@ static char rcsid[] = "$OpenBSD: mktemp.c,v 1.13 1998/06/30 23:03:13 deraadt Exp
#include <ctype.h>
#include <unistd.h>
+#include "config.h"
#include "helper.h"
+#ifndef HAVE_MKDTEMP
+
static int _gettemp __P((char *, int *, int, int));
int
@@ -181,3 +184,5 @@ _gettemp(path, doopen, domkdir, slen)
}
/*NOTREACHED*/
}
+
+#endif /* !HAVE_MKDTEMP */
diff --git a/mktemp.h b/mktemp.h
index 5d380058..ac92cbae 100644
--- a/mktemp.h
+++ b/mktemp.h
@@ -1,7 +1,11 @@
#ifndef _MKTEMP_H
#define _MKTEMP_H
+
+#include "config.h"
+#ifndef HAVE_MKDTEMP
int mkstemps(char *path, int slen);
int mkstemp(char *path);
char *mkdtemp(char *path);
+#endif /* !HAVE_MKDTEMP */
#endif /* _MKTEMP_H */
diff --git a/rc4.c b/rc4.c
index a426188a..998a1077 100644
--- a/rc4.c
+++ b/rc4.c
@@ -41,6 +41,9 @@
/* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */
+#include "config.h"
+
+#ifndef HAVE_ARC4RANDOM
#include "rc4.h"
@@ -103,3 +106,4 @@ void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len)
c++;
}
}
+#endif /* !HAVE_ARC4RANDOM */
diff --git a/rc4.h b/rc4.h
index 904affec..1be64aca 100644
--- a/rc4.h
+++ b/rc4.h
@@ -44,6 +44,9 @@
#ifndef _RC4_H
#define _RC4_H
+#include "config.h"
+#ifndef HAVE_ARC4RANDOM
+
/*! \struct rc4_t
\brief RC4 stream cipher state object
\var s State array
@@ -107,4 +110,6 @@ void rc4_crypt(rc4_t *r, unsigned char *plaintext, int len);
*/
void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len);
+#endif /* !HAVE_ARC4RANDOM */
+
#endif /* _RC4_H */
diff --git a/strlcpy.c b/strlcpy.c
index 300a28bc..4df4080d 100644
--- a/strlcpy.c
+++ b/strlcpy.c
@@ -34,6 +34,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp
#include <sys/types.h>
#include <string.h>
+#include "config.h"
+#ifndef HAVE_STRLCPY
+
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
@@ -66,3 +69,5 @@ size_t strlcpy(dst, src, siz)
return(s - src - 1); /* count does not include NUL */
}
+
+#endif /* !HAVE_STRLCPY */
diff --git a/strlcpy.h b/strlcpy.h
index 824df300..9afbd39c 100644
--- a/strlcpy.h
+++ b/strlcpy.h
@@ -1,4 +1,9 @@
#ifndef _STRLCPY_H
#define _STRLCPY_H
+
+#include "config.h"
+#ifndef HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t siz);
+#endif /* !HAVE_STRLCPY */
+
#endif /* _STRLCPY_H */