pgbackrest.git / summary / log / commit / refs
commit e044eaf55faf102d84389b04ff79a7a00fef0965
Author: David Steele <david@pgmasters.net>
Date: Tue Aug 04 13:23:59 2020 +0000
Use forkSafe() in common/exec module.
forkSafe() will throw an exception if the fork fails. This is a pretty unlikely scenario but the function is already there so may as well use it.
src/common/exec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/common/exec.c b/src/common/exec.c
index 2e3231f0b..c5ca437bb 100644
--- a/src/common/exec.c
+++ b/src/common/exec.c
@@ -13,6 +13,7 @@ Execute Process
#include "common/debug.h"
#include "common/log.h"
#include "common/exec.h"
+#include "common/fork.h"
#include "common/io/handleRead.h"
#include "common/io/handleWrite.h"
#include "common/io/io.h"
@@ -315,7 +316,7 @@ execOpen(Exec *this)
THROW_ON_SYS_ERROR(pipe(pipeError) == -1, KernelError, "unable to create error pipe");
// Fork the subprocess
- this->processId = fork();
+ this->processId = forkSafe();
// Exec command in the child process
if (this->processId == 0)
[parent: 5a9856c2f9ae]