Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 69407 | Differences between
and this patch

Collapse All | Expand All

(-)bash.orig/config.h.in (+6 lines)
Lines 606-611 Link Here
606
/* Define if you have the putenv function.  */
606
/* Define if you have the putenv function.  */
607
#undef HAVE_PUTENV
607
#undef HAVE_PUTENV
608
608
609
/* Define if you have the random function.  */
610
#undef HAVE_RANDOM
611
609
/* Define if you have the readlink function. */
612
/* Define if you have the readlink function. */
610
#undef HAVE_READLINK
613
#undef HAVE_READLINK
611
614
Lines 696-701 Link Here
696
/* Define if you have the strsignal function or macro. */
699
/* Define if you have the strsignal function or macro. */
697
#undef HAVE_STRSIGNAL
700
#undef HAVE_STRSIGNAL
698
701
702
/* Define if you have the srandom function.  */
703
#undef HAVE_SRANDOM
704
699
/* Define if you have the sysconf function. */
705
/* Define if you have the sysconf function. */
700
#undef HAVE_SYSCONF
706
#undef HAVE_SYSCONF
701
707
(-)bash.orig/variables.c (-3 / +13 lines)
Lines 1098-1113 Link Here
1098
static unsigned long rseed = 1;
1098
static unsigned long rseed = 1;
1099
static int last_random_value;
1099
static int last_random_value;
1100
1100
1101
/* A linear congruential random number generator based on the example
1101
/* Use the random number genrator provided by the standard C library,
1102
   one in the ANSI C standard.  This one isn't very good, but a more
1102
   else use a linear congruential random number generator based on the
1103
   complicated one is overkill. */
1103
   ANSI C standard.  This one isn't very good (the values are alternately
1104
   odd and even, for example), but a more complicated one is overkill. */
1104
1105
1105
/* Returns a pseudo-random number between 0 and 32767. */
1106
/* Returns a pseudo-random number between 0 and 32767. */
1106
static int
1107
static int
1107
brand ()
1108
brand ()
1108
{
1109
{
1110
#if defined(HAVE_RANDOM)
1111
  rseed = (unsigned int) (labs(random()) & 32767);
1112
  return rseed;
1113
#else
1109
  rseed = rseed * 1103515245 + 12345;
1114
  rseed = rseed * 1103515245 + 12345;
1110
  return ((unsigned int)((rseed >> 16) & 32767));	/* was % 32768 */
1115
  return ((unsigned int)((rseed >> 16) & 32767));	/* was % 32768 */
1116
#endif
1111
}
1117
}
1112
1118
1113
/* Set the random number generator seed to SEED. */
1119
/* Set the random number generator seed to SEED. */
Lines 1115-1122 Link Here
1115
sbrand (seed)
1121
sbrand (seed)
1116
     unsigned long seed;
1122
     unsigned long seed;
1117
{
1123
{
1124
#if defined(HAVE_SRANDOM)
1125
  srandom(seed);
1126
#else
1118
  rseed = seed;
1127
  rseed = seed;
1119
  last_random_value = 0;
1128
  last_random_value = 0;
1129
#endif
1120
}
1130
}
1121
1131
1122
static SHELL_VAR *
1132
static SHELL_VAR *
(-)bash/configure.in~ (+3 lines)
Lines 667-672 Link Here
667
667
668
AC_FUNC_MKTIME
668
AC_FUNC_MKTIME
669
669
670
dnl checks for random functions
671
AC_CHECK_FUNCS(random srandom)
672
670
dnl
673
dnl
671
dnl Checks for lib/intl and related code (uses some of the output from
674
dnl Checks for lib/intl and related code (uses some of the output from
672
dnl AM_GNU_GETTEXT)
675
dnl AM_GNU_GETTEXT)

Return to bug 69407