* 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

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.66 2006/09/21 22:08:26 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.67 2006/09/30 02:13:20 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -3872,5 +3872,5 @@ category: pdksh
stdin:
echo $KSH_VERSION
expected-stdout:
@(#)MIRBSD KSH R28 2006/08/28
@(#)MIRBSD KSH R28 2006/09/30
---

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);

4
sh.h
View File

@ -8,8 +8,8 @@
/* $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.44 2006/09/21 22:05:46 tg Exp $"
#define MKSH_VERSION "R28 2006/08/28"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.45 2006/09/30 02:13:21 tg Exp $"
#define MKSH_VERSION "R28 2006/09/30"
#include <sys/param.h>