]> git.neil.brown.name Git - gta04-gsm-voice-routing.git/commitdiff
Dont report errors on SIGTERM/SIGINT
authorRadek Polak <psonek2@seznam.cz>
Fri, 30 Mar 2012 21:34:41 +0000 (23:34 +0200)
committerRadek Polak <psonek2@seznam.cz>
Fri, 30 Mar 2012 21:34:41 +0000 (23:34 +0200)
gsm-voice-routing.c

index 25f1e15ed5741a5253208c2116f18db357bcaa54..9e060a284d43be6ef3bc8f0fa2495dce37e66324 100644 (file)
@@ -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);