changeset 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
files src/X_supp.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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);
 	    }
         }