From 9b309d27996abd59c1bd35fa94e801923c11655c Mon Sep 17 00:00:00 2001 From: Radek Polak Date: Fri, 30 Mar 2012 23:34:41 +0200 Subject: [PATCH] Dont report errors on SIGTERM/SIGINT --- gsm-voice-routing.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gsm-voice-routing.c b/gsm-voice-routing.c index 25f1e15..9e060a2 100644 --- a/gsm-voice-routing.c +++ b/gsm-voice-routing.c @@ -119,7 +119,8 @@ struct route_stream /* Dump error on stderr with stream and error description, and return given return_code */ -static int err(const char *msg, int snd_err, struct route_stream *s, int return_code) +static int err(const char *msg, int snd_err, struct route_stream *s, + int return_code) { fprintf(logfile, "%s (%s): %s", s->id, s->pcm_name, msg); if (snd_err < 0) { @@ -295,6 +296,10 @@ static int route_stream_read(struct route_stream *s) return 0; } + if (terminating) { + return ERR_TERMINATING; + } + /* EPIPE means overrun */ if (rc == -EPIPE) { err("overrun occured", rc, s, ERR_READ_OVERRUN); @@ -322,6 +327,10 @@ static int route_stream_write(struct route_stream *s) return 0; } + if (terminating) { + return ERR_TERMINATING; + } + /* EPIPE means underrun */ if (rc == -EPIPE) { err("underrun occured", rc, s, ERR_WRITE_UNDERRUN); -- 2.39.5