1
0
Fork 0
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:
Steffen Vogel 2022-02-24 07:46:02 -05:00
parent 3ec03e1a72
commit 26ff62a594

View file

@ -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();