Use more portable random seed generation.

The new function md_random_seed() has replaced time() + getpid() and
similar methods.  Putting everything in mdport.c slightly reduces the
warnings and workarounds.
This commit is contained in:
John "Elwin" Edwards 2017-01-28 15:49:41 -05:00
parent c194ec3dc9
commit 62047972cc
29 changed files with 123 additions and 81 deletions

View file

@ -47,8 +47,6 @@ int
main(int argc, char *argv[], char *envp[])
{
register char *env;
int lowtime;
time_t now;
#ifdef PC7300
int hardwindow; /* Do we have a hardware window? */
#endif
@ -179,10 +177,9 @@ main(int argc, char *argv[], char *envp[])
if (argc == 2)
if (!restore(argv[1], envp)) /* Note: restore will never return */
exit(1);
lowtime = (int) time(&now);
dnum = (wizard && getenv("SEED") != NULL ?
atoi(getenv("SEED")) :
lowtime + getpid());
md_random_seed());
if (wizard)
printf("Hello %s, welcome to dungeon #%d\n", whoami, dnum);
else