mirror of
https://github.com/danog/process.git
synced 2025-01-22 05:41:17 +01:00
Simpler exit code piping
This commit is contained in:
parent
f2a8b44c40
commit
53b45ce0b9
@ -132,9 +132,7 @@ class Process {
|
||||
["pipe", "w"], // exit code pipe
|
||||
];
|
||||
|
||||
$nd = \strncasecmp(\PHP_OS, "WIN", 3) === 0 ? "NUL" : "/dev/null";
|
||||
|
||||
$command = \sprintf('(%s) 3>%s; code=$?; echo $code >&3; exit $code', $this->command, $nd);
|
||||
$command = $this->command . "; echo $? >&3";
|
||||
|
||||
$this->process = @\proc_open($command, $fd, $pipes, $this->cwd ?: null, $this->env ?: null, $this->options);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user