mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Use PostmasterRandom(), not random(), for DSM control segment ID.
Otherwise, every startup gets the same "random" value, which is definitely not what was intended.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "lib/ilist.h"
|
||||
#include "miscadmin.h"
|
||||
#include "postmaster/postmaster.h"
|
||||
#include "storage/dsm.h"
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/lwlock.h"
|
||||
@@ -179,7 +180,7 @@ dsm_postmaster_startup(PGShmemHeader *shim)
|
||||
{
|
||||
Assert(dsm_control_address == NULL);
|
||||
Assert(dsm_control_mapped_size == 0);
|
||||
dsm_control_handle = random();
|
||||
dsm_control_handle = (dsm_handle) PostmasterRandom();
|
||||
if (dsm_control_handle == 0)
|
||||
continue;
|
||||
if (dsm_impl_op(DSM_OP_CREATE, dsm_control_handle, segsize,
|
||||
|
Reference in New Issue
Block a user