From 8177ee8bf6639b86e3b5e73ccca17c14655ed55d Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 20 Feb 2003 13:37:16 +0000 Subject: [PATCH] add logging on eof git-svn-id: file:///home/svn/nwr/trunk@17 103c2249-d0a5-da11-ade6-0050bffea3d9 --- log.cpp | 1 + monitor.cpp | 1 + rec.cpp | 1 + splitter.cpp | 1 + squelch.cpp | 1 + streamer.cpp | 2 ++ 6 files changed, 7 insertions(+) diff --git a/log.cpp b/log.cpp index 8e3d188..94b61cb 100644 --- a/log.cpp +++ b/log.cpp @@ -16,6 +16,7 @@ int main(int argc, char *argv[]) char buf[4096]; int n = fread(buf, 1, sizeof(buf), stdin); if (n == 0) { + fprintf(stderr, "log: eof on input\n"); break; } int hour = (time(0) / 3600) % 24; diff --git a/monitor.cpp b/monitor.cpp index 7bd80d7..3d63ee2 100644 --- a/monitor.cpp +++ b/monitor.cpp @@ -63,6 +63,7 @@ int main(int argc, char *argv[]) char buf[4096]; int n = fread(buf, 1, sizeof(buf), f); if (n == 0) { + fprintf(stderr, "monitor: eof on input\n"); break; } float fbuf[sizeof(buf)/2]; diff --git a/rec.cpp b/rec.cpp index cbd165b..7cd3781 100644 --- a/rec.cpp +++ b/rec.cpp @@ -57,6 +57,7 @@ int main(int argc, char *argv[]) char buf[4096]; int n = read(fd, buf, sizeof(buf)); if (n == 0) { + fprintf(stderr, "rec: eof on input\n"); break; } fwrite(buf, 1, n, f); diff --git a/splitter.cpp b/splitter.cpp index 527a662..cb57a6d 100644 --- a/splitter.cpp +++ b/splitter.cpp @@ -37,6 +37,7 @@ int main(int argc, char *argv[]) perror("read"); break; } else if (n == 0) { + fprintf(stderr, "splitter: eof on input\n"); break; } for (int i = 0; i < nfds; i++) { diff --git a/squelch.cpp b/squelch.cpp index 93bb648..d291d00 100644 --- a/squelch.cpp +++ b/squelch.cpp @@ -9,6 +9,7 @@ int main(int argc, char *argv[]) char buf[4096]; int n = fread(buf, 1, sizeof(buf), stdin); if (n == 0) { + fprintf(stderr, "squelch: eof on input\n"); break; } for (int i = 0; i < n/2; i++) { diff --git a/streamer.cpp b/streamer.cpp index d4a6161..1714027 100644 --- a/streamer.cpp +++ b/streamer.cpp @@ -172,6 +172,7 @@ printf("RawInputStream::notifyRead\n"); perror("read"); exit(1); } else if (n == 0) { + fprintf(stderr, "streamer: eof on input\n"); exit(0); } //printf("read raw %d\n", n); @@ -235,6 +236,7 @@ bool TitleMonitor::notifyRead() if (buf[i] == '\n') { Title = title; title.erase(); + printf("Title: %s\n", Title.c_str()); } else { title += buf[i]; }