mirror of
https://github.com/danog/parallel.git
synced 2024-12-02 09:37:57 +01:00
Add eof check on STDIN
This commit is contained in:
parent
fe4df13ab9
commit
fd6c531d87
@ -50,7 +50,7 @@ Loop::run(function () use ($argc, $argv) {
|
|||||||
|
|
||||||
// Read random key from STDIN and send back to parent over IPC socket to authenticate.
|
// Read random key from STDIN and send back to parent over IPC socket to authenticate.
|
||||||
do {
|
do {
|
||||||
if (($chunk = \fread(\STDIN, Process::KEY_LENGTH)) === false) {
|
if (($chunk = \fread(\STDIN, Process::KEY_LENGTH)) === false || \feof(\STDIN)) {
|
||||||
\trigger_error(E_USER_ERROR, "Could not read key from parent");
|
\trigger_error(E_USER_ERROR, "Could not read key from parent");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user