This looks a little suspicious:

 >     nfds = fds;
 >     res = select(fdcnt, &nfds, 0, 0, 0);
 >     if (res == -1) {
 >         perror("select");
 >         return -1;
 >     }
 > 
 >     if (FD_ISSET(cb->cm_channel->fd, &fds)) {
 >         // got a disconnect event?

you set nfds to fds, pass &nfds into select() and then check if the
cm_channel fd is set in the original fds.  Seems wrong to me.

Not sure why you need two fd_set variables anyway.  (And IMHO select()
is obsolete and should never be used ... poll() is a better interface in
every way, and if you can take a bit more complexity epoll is better still)

 - R.
-- 
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to