- Notifications
You must be signed in to change notification settings - Fork5
Commit98c5065
committed
Increase the number of different values used when seeding random().
When a backend process is forked, we initialize the system's random numbergenerator with srandom(). The seed used is derived from the backend's pidand the timestamp. However, we only used the microseconds part of thetimestamp, and it was XORed with the pid, so the total range of differentseed values chosen was 0-999999. That's quite limited.Change the code to also use the seconds part of the timestamp in the seed,and shift the microseconds so that all 32 bits of the seed are used.Honza Horak1 parent75fdcec commit98c5065
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4033 | 4033 |
| |
4034 | 4034 |
| |
4035 | 4035 |
| |
4036 |
| - | |
| 4036 | + | |
4037 | 4037 |
| |
4038 |
| - | |
| 4038 | + | |
4039 | 4039 |
| |
4040 | 4040 |
| |
4041 | 4041 |
| |
|
0 commit comments
Comments
(0)