You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2002/11/14 20:55:00 UTC
cvs commit: apr/misc/unix rand.c
jorton 2002/11/14 11:55:00
Modified: . configure.in acconfig.h
misc/unix rand.c
Log:
- define DEV_RANDOM as a string literal so it doesn't have to be
converted into one later.
- remove DEV_RANDOM from acconfig.h
Revision Changes Path
1.499 +4 -4 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.498
retrieving revision 1.499
diff -u -r1.498 -r1.499
--- configure.in 14 Nov 2002 18:07:14 -0000 1.498
+++ configure.in 14 Nov 2002 19:54:59 -0000 1.499
@@ -1628,21 +1628,21 @@
if test "$apr_devrandom" = "yes"; then
if test -r "/dev/random"; then
- AC_DEFINE(DEV_RANDOM, [/dev/random], [Define to path of random device])
+ AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/random"], [Define to path of random device])
AC_MSG_RESULT(/dev/random)
rand="1"
elif test -r "/dev/arandom"; then
- AC_DEFINE(DEV_RANDOM, [/dev/arandom])
+ AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/arandom"])
AC_MSG_RESULT(/dev/arandom)
rand="1"
elif test -r "/dev/urandom"; then
- AC_DEFINE(DEV_RANDOM, [/dev/urandom])
+ AC_DEFINE_UNQUOTED(DEV_RANDOM, ["/dev/urandom"])
AC_MSG_RESULT(/dev/urandom)
rand="1"
fi
elif test "$apr_devrandom" != "no"; then
if test -r "$apr_devrandom"; then
- AC_DEFINE(DEV_RANDOM, [$apr_devrandom])
+ AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"])
AC_MSG_RESULT($apr_devrandom)
rand="1"
else
1.60 +0 -1 apr/acconfig.h
Index: acconfig.h
===================================================================
RCS file: /home/cvs/apr/acconfig.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- acconfig.h 14 Nov 2002 18:30:02 -0000 1.59
+++ acconfig.h 14 Nov 2002 19:54:59 -0000 1.60
@@ -4,7 +4,6 @@
@TOP@
/* Various #defines we need to know about */
-#undef DEV_RANDOM
#undef EGD_DEFAULT_SOCKET
#undef HAVE_isascii
1.16 +1 -5 apr/misc/unix/rand.c
Index: rand.c
===================================================================
RCS file: /home/cvs/apr/misc/unix/rand.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- rand.c 13 Sep 2002 15:43:30 -0000 1.15
+++ rand.c 14 Nov 2002 19:55:00 -0000 1.16
@@ -76,10 +76,6 @@
#if APR_HAS_RANDOM
-/* This tells the preprocessor to put quotes around the value. */
-#define XSTR(x) #x
-#define STR(x) XSTR(x)
-
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
int length)
{
@@ -88,7 +84,7 @@
int rnd, rc;
apr_size_t got, tot;
- if ((rnd = open(STR(DEV_RANDOM), O_RDONLY)) == -1)
+ if ((rnd = open(DEV_RANDOM, O_RDONLY)) == -1)
return errno;
for (tot=0; tot<length; tot += got) {