mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
hook: fix eof handling
This commit is contained in:
parent
3ec03e1a72
commit
26ff62a594
1 changed files with 2 additions and 6 deletions
|
@ -261,18 +261,14 @@ check: if (optarg == endptr)
|
|||
h->prepare(input->getSignals());
|
||||
h->start();
|
||||
|
||||
while (!stop) {
|
||||
while (!stop && !feof(stdin)) {
|
||||
ret = sample_alloc_many(&p, smps, cnt);
|
||||
if (ret != cnt)
|
||||
throw RuntimeError("Failed to allocate {} smps from pool", cnt);
|
||||
|
||||
recv = input->scan(stdin, smps, cnt);
|
||||
if (recv < 0) {
|
||||
if (feof(stdin))
|
||||
break;
|
||||
|
||||
if (recv < 0)
|
||||
throw RuntimeError("Failed to read from stdin");
|
||||
}
|
||||
|
||||
timespec now = time_now();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue