8000 bug #54495 [Process] Don't call sigprocmask if there is no ignored si… · symfony/symfony@fd1d19e · GitHub
[go: up one dir, main page]

Skip to content

Commit fd1d19e

Browse files
bug #54495 [Process] Don't call sigprocmask if there is no ignored signals (joelwurtz)
This PR was merged into the 7.1 branch. Discussion ---------- [Process] Don't call sigprocmask if there is no ignored signals | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT It seems that passing an empty signal list makes an error on php 8.4 see https://github.com/symfony/symfony/actions/runs/8566954369/job/23477741854 This should fix this case Commits ------- 3cf4e36 fix(process): don't call sigprocmask if there is no ignored signals
2 parents cd0dbb8 + 3cf4e36 commit fd1d19e

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 ($this->ignoredSignals && \function_exists('pcntl_sigprocmask')) {
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 ($this->ignoredSignals && \function_exists('pcntl_sigprocmask')) {
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