diff options
| author | Tom Lane | 2000-08-07 00:51:42 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-08-07 00:51:42 +0000 |
| commit | 9426047021651d8d7b6595c1377aef1909afcacd (patch) | |
| tree | 737356deee745db64bacbdd589f1562ec9398125 /src/backend/postmaster | |
| parent | 259489bab7d01b6acc0bdc2c2938ecb22b1f5c8d (diff) | |
Clean up bogosities in use of random(3) and srandom(3) --- do not assume
that RAND_MAX applies to them, since it doesn't. Instead add a
config.h parameter MAX_RANDOM_VALUE. This is currently set at 2^31-1
but could be auto-configured if that ever proves necessary. Also fix
some outright bugs like calling srand() where srandom() is appropriate.
Diffstat (limited to 'src/backend/postmaster')
| -rw-r--r-- | src/backend/postmaster/postmaster.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 629ab48e8c0..9626f3bcf8b 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.158 2000/07/28 02:13:26 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.159 2000/08/07 00:51:30 tgl Exp $ * * NOTES * @@ -1850,7 +1850,7 @@ DoBackend(Port *port) */ random_seed = 0; gettimeofday(&now, &tz); - srandom(now.tv_usec); + srandom((unsigned int) now.tv_usec); /* ---------------- * Now, build the argv vector that will be given to PostgresMain. @@ -2029,7 +2029,6 @@ RandomSalt(char *salt) static long PostmasterRandom(void) { - static bool initialized = false; if (!initialized) |
