diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-09-20 12:24:44 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-09-20 12:30:42 -0400 |
commit | 626312d1b3ee0c94f7ed685f751878d810ab53fc (patch) | |
tree | 746924ec6775a0aec55164c4fbcc541789c0d8ef /src/backend/storage/ipc | |
parent | c23b2523d3fcc09524e6720d7c2558ba1ee6c239 (diff) |
Use PostmasterRandom(), not random(), for DSM control segment ID.
Otherwise, every startup gets the same "random" value, which is
definitely not what was intended.
Diffstat (limited to 'src/backend/storage/ipc')
-rw-r--r-- | src/backend/storage/ipc/dsm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index 7ce45caaf9b..357e8a98e54 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -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, |