aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonan Le Martret <ronan.lemartret@iot.bzh>2017-11-23 16:06:05 +0100
committerRonan Le Martret <ronan.lemartret@iot.bzh>2017-11-23 16:06:05 +0100
commit720e487cab65588faf43907b10dd36266b0779a9 (patch)
tree826bdcc7595476b0e2caf214aa20a447d0dcd50d
parent9e61ad7e7b8d2742822138d2d02bc5356204936c (diff)
Fix infinity loop erroreel_4.99.3eel/4.99.34.99.3
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
-rw-r--r--alsa-hook/PolicyAlsaHook.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/alsa-hook/PolicyAlsaHook.c b/alsa-hook/PolicyAlsaHook.c
index 44f5ce9..146ff5b 100644
--- a/alsa-hook/PolicyAlsaHook.c
+++ b/alsa-hook/PolicyAlsaHook.c
@@ -111,10 +111,14 @@ static void *LoopInThread(void *handle) {
for (;;) {
if (afbClient->verbose) printf("ON-MAINLOOP ping=%d\n", count++);
- sd_event_run(afbClient->sdLoop, watchdog);
- }
+ int res = sd_event_run(afbClient->sdLoop, watchdog);
- return NULL;
+ if ( res < 0 )
+ {
+ printf("ERROR in LoopInThread \"%i\" Break ON-MAINLOOP.\n", res);
+ break;
+ }
+ }
}
// lost connect with the AudioDaemon