comparison src/X_supp.c @ 1004:d6035efd64dc refine_backend_if

Use MB_MAX()
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 22 Nov 2010 00:42:30 +0800
parents 4b1bef7e5516
children 714169f33f13
comparison
equal deleted inserted replaced
1003:4b1bef7e5516 1004:d6035efd64dc
274 FD_ZERO(&wfds); 274 FD_ZERO(&wfds);
275 for(i = 0; i < io_man->n_monitor; i++) { 275 for(i = 0; i < io_man->n_monitor; i++) {
276 if(io_man->monitors[i].type == MB_IO_R || 276 if(io_man->monitors[i].type == MB_IO_R ||
277 io_man->monitors[i].type == MB_IO_RW) { 277 io_man->monitors[i].type == MB_IO_RW) {
278 FD_SET(io_man->monitors[i].fd, &rfds); 278 FD_SET(io_man->monitors[i].fd, &rfds);
279 if(nfds <= io_man->monitors[i].fd) 279 nfds = MB_MAX(nfds, io_man->monitors[i].fd + 1);
280 nfds = io_man->monitors[i].fd + 1;
281 } 280 }
282 if(io_man->monitors[i].type == MB_IO_W || 281 if(io_man->monitors[i].type == MB_IO_W ||
283 io_man->monitors[i].type == MB_IO_RW) { 282 io_man->monitors[i].type == MB_IO_RW) {
284 FD_SET(io_man->monitors[i].fd, &wfds); 283 FD_SET(io_man->monitors[i].fd, &wfds);
285 if(nfds <= io_man->monitors[i].fd) 284 nfds = MB_MAX(nfds, io_man->monitors[i].fd + 1);
286 nfds = io_man->monitors[i].fd + 1;
287 } 285 }
288 } 286 }
289 287
290 get_now(&now); 288 get_now(&now);
291 r = mb_tman_next_timeout(tman, &now, &tmo); 289 r = mb_tman_next_timeout(tman, &now, &tmo);