# HG changeset patch # User Thinker K.F. Li # Date 1290357750 -28800 # Node ID d6035efd64dc0a244b4be0b0638253bbc7367bdf # Parent 4b1bef7e55163304799b084bddd83b4ec4993f7a Use MB_MAX() diff -r 4b1bef7e5516 -r d6035efd64dc src/X_supp.c --- a/src/X_supp.c Mon Nov 22 00:42:30 2010 +0800 +++ b/src/X_supp.c Mon Nov 22 00:42:30 2010 +0800 @@ -276,14 +276,12 @@ if(io_man->monitors[i].type == MB_IO_R || io_man->monitors[i].type == MB_IO_RW) { FD_SET(io_man->monitors[i].fd, &rfds); - if(nfds <= io_man->monitors[i].fd) - nfds = io_man->monitors[i].fd + 1; + nfds = MB_MAX(nfds, io_man->monitors[i].fd + 1); } if(io_man->monitors[i].type == MB_IO_W || io_man->monitors[i].type == MB_IO_RW) { FD_SET(io_man->monitors[i].fd, &wfds); - if(nfds <= io_man->monitors[i].fd) - nfds = io_man->monitors[i].fd + 1; + nfds = MB_MAX(nfds, io_man->monitors[i].fd + 1); } }