booby-trap-fork.patch
text/x-diff
Filename: booby-trap-fork.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/bin/pg_dump/parallel.c | 4 | 1 |
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index 1410bcd..aa2b8be 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -994,7 +994,10 @@ ParallelBackupStart(ArchiveHandle *AH)
wi, 0, &(slot->threadId));
slot->hThread = handle;
#else /* !WIN32 */
- pid = fork();
+ if (random() > 1000000000)
+ pid = fork();
+ else
+ pid = -1, errno = EINVAL;
if (pid == 0)
{
/* we are the worker */