mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-03-05 15:05:48 +02:00
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.
This commit is contained in:
parent
5a9856c2f9
commit
e044eaf55f
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user