Skip to content

Commit e66ac98

Browse files
committed
Use rand() so it works on windows as well
1 parent bc0cff0 commit e66ac98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pg_crash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _PG_init(void)
3737
DefineCustomStringVariable(
3838
"crash.signals",
3939
"A list of signals to choose from.",
40-
"Random signal is chosen out of the ones contained in the set.",
40+
"Random signal is chosen out of the ones contained in the set (space-separated).",
4141
&crash_signals,
4242
"15",
4343
PGC_POSTMASTER,
@@ -152,11 +152,11 @@ crash_worker_main(Datum main_arg)
152152
break;
153153

154154
/* Select signal. */
155-
n = random() % list_length(signals);
155+
n = rand() % list_length(signals);
156156
signal = list_nth_int(signals, n);
157157

158158
/* Select backend. */
159-
n = random() % nprocs;
159+
n = rand() % nprocs;
160160
j = 0;
161161
for (i = 0;; i++)
162162
{

0 commit comments

Comments
 (0)