dnl Process this file with autoconf to produce a configure script.
dnl
-dnl $Id: configure.in,v 1.207 2016/12/24 16:00:49 fabiankeil Exp $
+dnl $Id: configure.in,v 1.208 2017/03/08 13:13:18 fabiankeil Exp $
dnl
dnl Written by and Copyright (C) 2001-2016 the
dnl Privoxy team. https://www.privoxy.org/
dnl AutoConf Initialization
dnl =================================================================
-AC_REVISION($Revision: 1.207 $)
+AC_REVISION($Revision: 1.208 $)
AC_INIT(jcc.c)
if test ! -f config.h.in; then
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([ \
access \
+ arc4random \
atexit \
getcwd \
gethostbyaddr \
-const char jcc_rcs[] = "$Id: jcc.c,v 1.450 2016/12/24 16:01:32 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.451 2017/03/08 13:15:49 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
privoxy_mutex_t localtime_mutex;
#endif /* ndef HAVE_GMTIME_R */
-#ifndef HAVE_RANDOM
+#if !defined(HAVE_ARC4RANDOM) && !defined(HAVE_RANDOM)
privoxy_mutex_t rand_mutex;
-#endif /* ndef HAVE_RANDOM */
+#endif /* !defined(HAVE_ARC4RANDOM) && !defined(HAVE_RANDOM) */
#endif /* def MUTEX_LOCKS_AVAILABLE */
privoxy_mutex_init(&localtime_mutex);
#endif /* ndef HAVE_GMTIME_R */
-#ifndef HAVE_RANDOM
+#if !defined(HAVE_ARC4RANDOM) && !defined(HAVE_RANDOM)
privoxy_mutex_init(&rand_mutex);
-#endif /* ndef HAVE_RANDOM */
+#endif /* !defined(HAVE_ARC4RANDOM) && !defined(HAVE_RANDOM) */
#endif /* def MUTEX_LOCKS_AVAILABLE */
}
{
int argc_pos = 0;
int do_config_test = 0;
+#ifndef HAVE_ARC4RANDOM
unsigned int random_seed;
+#endif
#ifdef unix
struct passwd *pw = NULL;
struct group *grp = NULL;
InitWin32();
#endif
+#ifndef HAVE_ARC4RANDOM
random_seed = (unsigned int)time(NULL);
#ifdef HAVE_RANDOM
srandom(random_seed);
#else
srand(random_seed);
#endif /* ifdef HAVE_RANDOM */
+#endif /* ifndef HAVE_ARC4RANDOM */
/*
* Unix signal handling
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.81 2016/02/26 12:29:17 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.82 2016/07/23 23:05:15 ler762 Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
if (range <= 0) return 0;
-#ifdef HAVE_RANDOM
+#ifdef HAVE_ARC4RANDOM
+ number = arc4random() % range + 1;
+#elif defined(HAVE_RANDOM)
number = random() % range + 1;
#elif defined(MUTEX_LOCKS_AVAILABLE)
privoxy_mutex_lock(&rand_mutex);
"might cause crashes, predictable results or even combine these fine options.");
number = rand() % (long int)(range + 1);
-#endif /* (def HAVE_RANDOM) */
+#endif /* (def HAVE_ARC4RANDOM) */
return number;
}