diff options
author | Yang Tse <yangsita@gmail.com> | 2012-11-26 16:20:53 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-11-26 16:23:47 +0100 |
commit | b33074d8931f2fd19f07ede99228abba393e2a4e (patch) | |
tree | 8c9188394d8638e25a04f2526c15139054a3aee9 | |
parent | 0683adbf50a99f0917c74cd3c5def77254ba9258 (diff) |
multi.c: disambiguate precedence of bitwise and relational operation
-rw-r--r-- | lib/multi.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/multi.c b/lib/multi.c index b4e01bd93..f7ad9cbef 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1017,10 +1017,13 @@ CURLMcode curl_multi_wait(CURLM *multi_handle, /* Add external file descriptions from poll-like struct curl_waitfd */ for(i = 0; i < extra_nfds; i++) { ufds[nfds].fd = extra_fds[i].fd; - ufds[nfds].events = (short) ( - ((extra_fds[i].events & CURL_WAIT_POLLIN) ? POLLIN : 0) | - ((extra_fds[i].events & CURL_WAIT_POLLPRI) ? POLLPRI : 0) | - ((extra_fds[i].events & CURL_WAIT_POLLOUT) ? POLLOUT : 0) ); + ufds[nfds].events = 0; + if(extra_fds[i].events & CURL_WAIT_POLLIN) + ufds[nfds].events |= POLLIN; + if(extra_fds[i].events & CURL_WAIT_POLLPRI) + ufds[nfds].events |= POLLPRI; + if(extra_fds[i].events & CURL_WAIT_POLLOUT) + ufds[nfds].events |= POLLOUT; ++nfds; } |