* avoid unaligned memory access causing SIGBUS on IA-64 (Itanic)

(incidentally, the information xor'd now is more random)
  only affects non-arc4random targets
* bump version
This commit is contained in:
tg
2006-09-30 02:13:21 +00:00
parent 367186ecbc
commit 7ae68e335c
3 changed files with 6 additions and 6 deletions

4
main.c
View File

@@ -6,7 +6,7 @@
#define EXTERN
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.48 2006/08/24 20:32:53 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.49 2006/09/30 02:13:21 tg Exp $");
extern char **environ;
@@ -188,7 +188,7 @@ main(int argc, char *argv[])
}
ppid = getppid();
#if !HAVE_ARC4RANDOM
srand((*((long *)kshname)) ^ ((long)time(NULL) * kshpid * ppid));
srand(((long)kshname) ^ ((long)time(NULL) * kshpid * ppid));
#endif
setint(global("PPID"), (long)ppid);