From 903c9bfaeab1d551cfa75e25d6eff958db062178 Mon Sep 17 00:00:00 2001 From: Daniel LEVAI Date: Wed, 1 Jun 2011 00:18:19 -0400 Subject: system/ksh: Updated for version openbsd49. Signed-off-by: dsomero --- system/ksh/patches/linux/var_c.diff | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 system/ksh/patches/linux/var_c.diff (limited to 'system/ksh/patches/linux/var_c.diff') diff --git a/system/ksh/patches/linux/var_c.diff b/system/ksh/patches/linux/var_c.diff new file mode 100644 index 0000000000..9483a3b4ce --- /dev/null +++ b/system/ksh/patches/linux/var_c.diff @@ -0,0 +1,53 @@ +--- ksh-openbsd_cvs/var.c 2010-02-23 12:49:23.000000000 +0100 ++++ ksh-openbsd_cvs.new/var.c 2010-04-01 21:01:24.145380963 +0200 +@@ -5,6 +5,7 @@ + #include "ksh_limval.h" + #include + #include ++#include "strlcpy.h" + + /* + * Variables +@@ -865,12 +866,6 @@ makenv(void) + } + + /* +- * Someone has set the srand() value, therefore from now on +- * we return values from rand() instead of arc4random() +- */ +-int use_rand = 0; +- +-/* + * Called after a fork in parent to bump the random number generator. + * Done to ensure children will not get the same random number sequence + * if the parent doesn't use $RANDOM. +@@ -878,8 +873,7 @@ int use_rand = 0; + void + change_random(void) + { +- if (use_rand) +- rand(); ++ rand(); + } + + /* +@@ -926,10 +920,7 @@ getspec(struct tbl *vp) + break; + case V_RANDOM: + vp->flag &= ~SPECIAL; +- if (use_rand) +- setint(vp, (long) (rand() & 0x7fff)); +- else +- setint(vp, (long) (arc4random() & 0x7fff)); ++ setint(vp, (long) (rand() & 0x7fff)); + vp->flag |= SPECIAL; + break; + #ifdef HISTORY +@@ -1030,7 +1021,6 @@ setspec(struct tbl *vp) + case V_RANDOM: + vp->flag &= ~SPECIAL; + srand((unsigned int)intval(vp)); +- use_rand = 1; + vp->flag |= SPECIAL; + break; + case V_SECONDS: -- cgit v1.2.3