summaryrefslogtreecommitdiff
path: root/util/spkmodem_recv/spkmodem-recv.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-06-04 15:27:29 +0100
committerLeah Rowe <leah@libreboot.org>2023-06-04 15:27:29 +0100
commita61ab37b67a1f860554989b6ff2491127259955f (patch)
tree887ec162ae70c98433400b3f72998dc385f11884 /util/spkmodem_recv/spkmodem-recv.c
parente8889fd107638923bdd6d8929d45a340d02e8ed7 (diff)
util/spkmodem-recv: always set errno on err()
This version of spkmodem uses err() to indicate an error, and the value of errno is used as exit status at all times, even when it is zero. When calling err(), it is intended that errno always be non-zero, so modify the code accordingly. 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c
index 77d64637..b19c49a4 100644
--- a/util/spkmodem_recv/spkmodem-recv.c
+++ b/util/spkmodem_recv/spkmodem-recv.c
@@ -72,7 +72,7 @@ handle_audio(void)
}
if (llp == FLUSH_TIMEOUT)
if (fflush(stdout) == EOF)
- err(errno, NULL);
+ err(ERR(), NULL);
if ((f2 <= FREQ_SEP_MIN) || (f2 >= FREQ_SEP_MAX)
|| (f1 <= FREQ_DATA_MIN) || (f1 >= FREQ_DATA_MAX)) {
@@ -120,7 +120,7 @@ print_char(void)
#if DEBUG
long stdin_pos = 0;
if ((stdin_pos = ftell(stdin)) == -1)
- err(errno, NULL);
+ err(ERR(), NULL);
printf ("%d %d %d @%ld\n", f1, f2, FREQ_DATA_THRESHOLD,
stdin_pos - sizeof(frame));
#endif