diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-10-10 17:49:17 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-10-10 17:49:17 +0200 |
commit | 3201a1ddb17ddac985fd06800628b0b54fc0a692 (patch) | |
tree | a9228d277bee909bc1b4151058253c6eae15606e /apps/dolmetschctl.c | |
parent | got rid of threads entirely (diff) |
improved poll() handling
Diffstat (limited to 'apps/dolmetschctl.c')
-rw-r--r-- | apps/dolmetschctl.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/dolmetschctl.c b/apps/dolmetschctl.c index b8f9197..9e3b3d5 100644 --- a/apps/dolmetschctl.c +++ b/apps/dolmetschctl.c @@ -65,15 +65,12 @@ int main_loop(osc_t* o, midi_t* m) printf("main_loop running...\n"); for (;;) { int err = poll(pfds, npfds, 200); - if(err < 0) { - if(errno == EINTR) - continue; - + if(err < 0 || errno != EINTR) { error(0, errno, "poll failed"); break; } - if(err == 0) { - // timeout is reached + if(err <= 0) { + // timeout or EINTR continue; } |