to speed up mksh, get rid of arc4random(3) uses and use the LCG always;

depend on ASLR for seeding
This commit is contained in:
tg
2010-07-04 17:33:58 +00:00
parent 2d6b4acba1
commit 4cbb5a9d46
8 changed files with 186 additions and 279 deletions

5
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.138 2010/01/29 09:34:29 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.139 2010/07/04 17:33:55 tg Exp $");
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
@ -1266,6 +1266,9 @@ chvt(const char *fn)
struct stat sb;
int fd;
/* for entropy */
kshstate_f.h = evilhash(fn);
if (*fn == '-') {
memcpy(dv, "-/dev/null", sizeof("-/dev/null"));
fn = dv + 1;