[asterisk-commits] russell: trunk r377977 - in /trunk: ./ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 13 10:18:57 CST 2012


Author: russell
Date: Thu Dec 13 10:18:52 2012
New Revision: 377977

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377977
Log:
Remove compile time check HAVE_DEV_URANDOM.

The code was doing a runtime check, anyway.  The compile time check isn't
always valid (cross-compiling, packages).

Review: https://reviewboard.asterisk.org/r/2245/

Modified:
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in
    trunk/main/utils.c

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=377977&r1=377976&r2=377977
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Dec 13 10:18:52 2012
@@ -719,11 +719,6 @@
 AC_MSG_RESULT(no)
 )
 
-if test "${cross_compiling}" = "no";
-then
-  AC_CHECK_FILE(/dev/urandom, AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define to 1 if your system has /dev/urandom.]))
-fi
-
 AC_MSG_CHECKING(for locale_t in locale.h)
 AC_LINK_IFELSE(
 [AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])],

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=377977&r1=377976&r2=377977
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Thu Dec 13 10:18:52 2012
@@ -172,9 +172,6 @@
 
 /* Define DAHDI headers version */
 #undef HAVE_DAHDI_VERSION
-
-/* Define to 1 if your system has /dev/urandom. */
-#undef HAVE_DEV_URANDOM
 
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
@@ -1223,11 +1220,6 @@
 /* Define to 1 if running on Darwin. */
 #undef _DARWIN_UNLIMITED_SELECT
 
-/* Enable large inode numbers on Mac OS X 10.5.  */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 

Modified: trunk/main/utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/utils.c?view=diff&rev=377977&r1=377976&r2=377977
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Thu Dec 13 10:18:52 2012
@@ -35,9 +35,7 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 
-#ifdef HAVE_DEV_URANDOM
 #include <fcntl.h>
-#endif
 
 #include <sys/syscall.h>
 #if defined(__APPLE__)
@@ -496,9 +494,7 @@
 	return inet_ntop(AF_INET, &ia, buf, INET_ADDRSTRLEN);
 }
 
-#ifdef HAVE_DEV_URANDOM
 static int dev_urandom_fd;
-#endif
 
 #ifndef __linux__
 #undef pthread_create /* For ast_pthread_create function only */
@@ -1494,7 +1490,7 @@
 long int ast_random(void)
 {
 	long int res;
-#ifdef HAVE_DEV_URANDOM
+
 	if (dev_urandom_fd >= 0) {
 		int read_res = read(dev_urandom_fd, &res, sizeof(res));
 		if (read_res > 0) {
@@ -1504,7 +1500,7 @@
 			return res % rm;
 		}
 	}
-#endif
+
 	/* XXX - Thread safety really depends on the libc, not the OS.
 	 *
 	 * But... popular Linux libc's (uClibc, glibc, eglibc), all have a
@@ -2035,9 +2031,7 @@
 
 int ast_utils_init(void)
 {
-#ifdef HAVE_DEV_URANDOM
 	dev_urandom_fd = open("/dev/urandom", O_RDONLY);
-#endif
 	base64_init();
 #ifdef DEBUG_THREADS
 #if !defined(LOW_MEMORY)




More information about the asterisk-commits mailing list