summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 c9aa51e4f..6959535d2 100644
--- a/helper.c
+++ b/helper.c
@@ -45,18 +45,15 @@
45 45
46#include "rc4.h" 46#include "rc4.h"
47#include "xmalloc.h" 47#include "xmalloc.h"
48 48#include "config.h"
49#include "helper.h" 49#include "helper.h"
50 50
51#ifndef HAVE_ARC4RANDOM
52
51void get_random_bytes(unsigned char *buf, int len); 53void get_random_bytes(unsigned char *buf, int len);
52 54
53static rc4_t *rc4 = NULL; 55static rc4_t *rc4 = NULL;
54 56
55void setproctitle(const char *fmt, ...)
56{
57 /* FIXME */
58}
59
60unsigned int arc4random(void) 57unsigned int arc4random(void)
61{ 58{
62 unsigned int r; 59 unsigned int r;
@@ -105,4 +102,11 @@ void get_random_bytes(unsigned char *buf, int len)
105 exit(1); 102 exit(1);
106 } 103 }
107} 104}
105#endif /* !HAVE_ARC4RANDOM */
108 106
107#ifndef HAVE_SETPROCTITLE
108void setproctitle(const char *fmt, ...)
109{
110 /* FIXME */
111}
112#endif /* !HAVE_SETPROCTITLE */
diff --git a/helper.h b/helper.h
index 309156a2c..0e53fac43 100644
--- a/helper.h
+++ b/helper.h
@@ -36,8 +36,15 @@
36#ifndef _HELPER_H 36#ifndef _HELPER_H
37#define _HELPER_H 37#define _HELPER_H
38 38
39#include "config.h"
40
41#ifndef HAVE_ARC4RANDOM
39unsigned int arc4random(void); 42unsigned int arc4random(void);
40void arc4random_stir(void); 43void arc4random_stir(void);
44#endif /* !HAVE_ARC4RANDOM */
45
46#ifndef HAVE_SETPROCTITLE
41void setproctitle(const char *fmt, ...); 47void setproctitle(const char *fmt, ...);
48#endif /* !HAVE_SETPROCTITLE */
42 49
43#endif /* _HELPER_H */ 50#endif /* _HELPER_H */
diff --git a/mktemp.c b/mktemp.c
index 69dc4dc6f..de11a6b53 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
47#include <ctype.h> 47#include <ctype.h>
48#include <unistd.h> 48#include <unistd.h>
49 49
50#include "config.h"
50#include "helper.h" 51#include "helper.h"
51 52
53#ifndef HAVE_MKDTEMP
54
52static int _gettemp __P((char *, int *, int, int)); 55static int _gettemp __P((char *, int *, int, int));
53 56
54int 57int
@@ -181,3 +184,5 @@ _gettemp(path, doopen, domkdir, slen)
181 } 184 }
182 /*NOTREACHED*/ 185 /*NOTREACHED*/
183} 186}
187
188#endif /* !HAVE_MKDTEMP */
diff --git a/mktemp.h b/mktemp.h
index 5d380058e..ac92cbae0 100644
--- a/mktemp.h
+++ b/mktemp.h
@@ -1,7 +1,11 @@
1#ifndef _MKTEMP_H 1#ifndef _MKTEMP_H
2#define _MKTEMP_H 2#define _MKTEMP_H
3
4#include "config.h"
5#ifndef HAVE_MKDTEMP
3int mkstemps(char *path, int slen); 6int mkstemps(char *path, int slen);
4int mkstemp(char *path); 7int mkstemp(char *path);
5char *mkdtemp(char *path); 8char *mkdtemp(char *path);
9#endif /* !HAVE_MKDTEMP */
6 10
7#endif /* _MKTEMP_H */ 11#endif /* _MKTEMP_H */
diff --git a/rc4.c b/rc4.c
index a426188aa..998a10774 100644
--- a/rc4.c
+++ b/rc4.c
@@ -41,6 +41,9 @@
41 41
42/* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */ 42/* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */
43 43
44#include "config.h"
45
46#ifndef HAVE_ARC4RANDOM
44#include "rc4.h" 47#include "rc4.h"
45 48
46 49
@@ -103,3 +106,4 @@ void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len)
103 c++; 106 c++;
104 } 107 }
105} 108}
109#endif /* !HAVE_ARC4RANDOM */
diff --git a/rc4.h b/rc4.h
index 904affec3..1be64acac 100644
--- a/rc4.h
+++ b/rc4.h
@@ -44,6 +44,9 @@
44#ifndef _RC4_H 44#ifndef _RC4_H
45#define _RC4_H 45#define _RC4_H
46 46
47#include "config.h"
48#ifndef HAVE_ARC4RANDOM
49
47/*! \struct rc4_t 50/*! \struct rc4_t
48 \brief RC4 stream cipher state object 51 \brief RC4 stream cipher state object
49 \var s State array 52 \var s State array
@@ -107,4 +110,6 @@ void rc4_crypt(rc4_t *r, unsigned char *plaintext, int len);
107*/ 110*/
108void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len); 111void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len);
109 112
113#endif /* !HAVE_ARC4RANDOM */
114
110#endif /* _RC4_H */ 115#endif /* _RC4_H */
diff --git a/strlcpy.c b/strlcpy.c
index 300a28bc3..4df4080d6 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
34#include <sys/types.h> 34#include <sys/types.h>
35#include <string.h> 35#include <string.h>
36 36
37#include "config.h"
38#ifndef HAVE_STRLCPY
39
37/* 40/*
38 * Copy src to string dst of size siz. At most siz-1 characters 41 * Copy src to string dst of size siz. At most siz-1 characters
39 * will be copied. Always NUL terminates (unless siz == 0). 42 * will be copied. Always NUL terminates (unless siz == 0).
@@ -66,3 +69,5 @@ size_t strlcpy(dst, src, siz)
66 69
67 return(s - src - 1); /* count does not include NUL */ 70 return(s - src - 1); /* count does not include NUL */
68} 71}
72
73#endif /* !HAVE_STRLCPY */
diff --git a/strlcpy.h b/strlcpy.h
index 824df300c..9afbd39c5 100644
--- a/strlcpy.h
+++ b/strlcpy.h
@@ -1,4 +1,9 @@
1#ifndef _STRLCPY_H 1#ifndef _STRLCPY_H
2#define _STRLCPY_H 2#define _STRLCPY_H
3
4#include "config.h"
5#ifndef HAVE_STRLCPY
3size_t strlcpy(char *dst, const char *src, size_t siz); 6size_t strlcpy(char *dst, const char *src, size_t siz);
7#endif /* !HAVE_STRLCPY */
8
4#endif /* _STRLCPY_H */ 9#endif /* _STRLCPY_H */