diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-03-13 21:51:51 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-03-13 21:51:51 +0000 |
commit | e2b198a3e133146b85c7a7c6b12af02e5735fe8b (patch) | |
tree | 53bf84f30fa107caf77c50fd09188c9f2b883120 /pjlib | |
parent | 7b80afbe61b63fcc3d539856e4da005b614d835a (diff) |
Ticket #512: Bug in select ioqueue causing unnecessary sleep() to be invoked (thanks Sergey Bakulin)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1868 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/src/pj/ioqueue_select.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pjlib/src/pj/ioqueue_select.c b/pjlib/src/pj/ioqueue_select.c index 7738f668..0d907894 100644 --- a/pjlib/src/pj/ioqueue_select.c +++ b/pjlib/src/pj/ioqueue_select.c @@ -689,7 +689,9 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout) count = pj_sock_select(ioqueue->nfds+1, &rfdset, &wfdset, &xfdset, timeout); - if (count <= 0) + if (count == 0) + return 0; + else if (count < 0) return -pj_get_netos_error(); else if (count > PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL) count = PJ_IOQUEUE_MAX_EVENTS_IN_SINGLE_POLL; |