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

@ -29,7 +29,6 @@ int
main(int argc, char *argv[], char *envp[])
{
register char *env;
int lowtime;
md_init();
@ -138,8 +137,6 @@ main(int argc, char *argv[], char *envp[])
if (!use_savedir)
md_normaluser();
lowtime = (int) time(NULL);
#ifdef WIZARD
noscore = wizard;
#endif
@ -149,7 +146,7 @@ main(int argc, char *argv[], char *envp[])
noscore = TRUE;
}
else
dnum = lowtime + getpid();
dnum = md_random_seed();
#ifdef WIZARD
if (wizard)
printf("Hello %s, welcome to dungeon #%d", whoami, dnum);