1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-30 04:39:01 +01:00

Add eof check on STDIN

This commit is contained in:
Aaron Piotrowski 2018-10-23 21:26:26 -05:00
parent fe4df13ab9
commit fd6c531d87
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -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.
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");
exit(1);
}