8000 fix(process): don't call sigprocmask if there is no ignored signals · symfony/symfony@9d269ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d269ea

Browse files
committed
fix(process): don't call sigprocmask if there is no ignored signals
1 parent 4c1d8eb commit 9d269ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public function start(?callable $callback = null, array $env = []): void
350350

351351
$oldMask = [];
352352

353-
if (\function_exists('pcntl_sigprocmask')) {
353+
if (\function_exists('pcntl_sigprocmask') && $this->ignoredSignals) {
354354
// we block signals we want to ignore, as proc_open will use fork / posix_spawn which will copy the signal mask this allow to block
355355
// signals in the child process
356356
pcntl_sigprocmask(\SIG_BLOCK, $this->ignoredSignals, $oldMask);
@@ -359,7 +359,7 @@ public function start(?callable $callback = null, array $env = []): void
359359
try {
360360
$process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options);
361361
} finally {
362-
if (\function_exists('pcntl_sigprocmask')) {
362+
if (\function_exists('pcntl_sigprocmask') && $this->ignoredSignals) {
363363
// we restore the signal mask here to avoid any side effects
364364
pcntl_sigprocmask(\SIG_SETMASK, $oldMask);
365365
}

0 commit comments

Comments
 (0)
0