summaryrefslogtreecommitdiff
path: root/util/spkmodem_recv/spkmodem-recv.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-12 05:13:44 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-12 05:13:44 +0000
commit59f04eba9ed32a7178e84e4e1a0a503a859a7889 (patch)
tree5e13052a411cdd34e477d27bf3019bcdd8b24500 /util/spkmodem_recv/spkmodem-recv.c
parent9ac03315958c20b1f6c0bac0988033d007c3d977 (diff)
util/spkmodem-recv: don't exit in print_stats
i treated ftell errors as fatal, but if fttell fails with ESPIPE, and someone's using -d, the program may exit immediately, even though there's no problem. instead, skip printing the offset (basically no debug). this fixes a bug that i introduced myself, when i forked this code, because i added that error check; the GNU code didn't have any check whatsoever. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_recv/spkmodem-recv.c')
-rw-r--r--util/spkmodem_recv/spkmodem-recv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c
index 52466215..ed3d41be 100644
--- a/util/spkmodem_recv/spkmodem-recv.c
+++ b/util/spkmodem_recv/spkmodem-recv.c
@@ -239,8 +239,14 @@ print_stats(struct decoder_state *st)
long pos;
pos = ftell(stdin);
- if (pos == -1)
- err(errno, "ftell");
+
+ if (pos == -1) {
+ printf("%d %d %d\n",
+ st->freq_data,
+ st->freq_separator,
+ FREQ_DATA_THRESHOLD);
+ return;
+ }
printf("%d %d %d @%ld\n",
st->freq_data,