diff --git a/sh.h b/sh.h index bfb58d0..023da8d 100644 --- a/sh.h +++ b/sh.h @@ -8,7 +8,7 @@ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ -#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.26 2006/05/10 18:54:12 tg Exp $" +#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.27 2006/06/21 19:35:38 tg Exp $" #include @@ -1285,3 +1285,11 @@ extern void tty_close(void); #define HAVE_ARC4RANDOM 1 #endif #endif + +#ifndef HAVE_ARC4RANDOM_PUSH +#if defined(__MirBSD__) && (MirBSD >= 0x07AD) +#define HAVE_ARC4RANDOM_PUSH 1 +#else +#define HAVE_ARC4RANDOM_PUSH 0 +#endif +#endif diff --git a/var.c b/var.c index 2ae8675..62e60df 100644 --- a/var.c +++ b/var.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/var.c,v 1.18 2006/05/26 22:17:21 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/var.c,v 1.19 2006/06/21 19:35:38 tg Exp $"); /* * Variables @@ -997,7 +997,7 @@ setspec(struct tbl *vp) srand((unsigned int)intval(vp)); #if HAVE_ARC4RANDOM use_rand = 1; -#if defined(__MirBSD__) && (MirBSD >= 0x07AD) +#if HAVE_ARC4RANDOM_PUSH arc4random_push((unsigned)vp ^ (unsigned)rand()); #endif #endif