diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index e2d8d7ae518..e0a15e9f099 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -400,7 +400,6 @@ static void processCancelRequest(Port *port, void *pkt); static int initMasks(fd_set *rmask); static void report_fork_failure_to_client(Port *port, int errnum); static CAC_state canAcceptConnections(void); -static long PostmasterRandom(void); static void RandomSalt(char *md5Salt); static void signal_child(pid_t pid, int signal); static bool SignalSomeChildren(int signal, int targets); @@ -5127,7 +5126,7 @@ RandomSalt(char *md5Salt) /* * PostmasterRandom */ -static long +long PostmasterRandom(void) { /* 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, diff --git a/src/include/postmaster/postmaster.h b/src/include/postmaster/postmaster.h index de463327806..9cf9e5a61d2 100644 --- a/src/include/postmaster/postmaster.h +++ b/src/include/postmaster/postmaster.h @@ -48,6 +48,7 @@ extern const char *progname; extern void PostmasterMain(int argc, char *argv[]) __attribute__((noreturn)); extern void ClosePostmasterPorts(bool am_syslogger); +extern long PostmasterRandom(void); extern int MaxLivePostmasterChildren(void);