[uim-commit] r794 - trunk/xim

ekato at freedesktop.org ekato at freedesktop.org
Fri Mar 18 22:19:18 PST 2005


Author: ekato
Date: 2005-03-18 22:19:15 -0800 (Fri, 18 Mar 2005)
New Revision: 794

Modified:
   trunk/xim/main.cpp
Log:
* xim/main.cpp (main_loop) : Use timeout value for select(2).


Modified: trunk/xim/main.cpp
===================================================================
--- trunk/xim/main.cpp	2005-03-18 04:57:13 UTC (rev 793)
+++ trunk/xim/main.cpp	2005-03-19 06:19:15 UTC (rev 794)
@@ -139,9 +139,14 @@
 static void main_loop()
 {
     fd_set rfds, wfds;
+    struct timeval tv;
+    
     while (1) {
 	FD_ZERO(&rfds);
 	FD_ZERO(&wfds);
+	tv.tv_sec = 0;
+	tv.tv_usec = 100000;
+
 	std::map<int, fd_watch_struct>::iterator it;
 	int  fd_max = 0;
 	for (it = fd_watch_stat.begin(); it != fd_watch_stat.end(); it++) {
@@ -153,7 +158,7 @@
 	    if (fd_max < fd)
 		fd_max = fd;
 	}
-	select(fd_max + 1, &rfds, &wfds, NULL, NULL);
+	select(fd_max + 1, &rfds, &wfds, NULL, &tv);
 	for (it = fd_watch_stat.begin(); it != fd_watch_stat.end(); it++) {
 	    int fd = it->first;
 	    if (FD_ISSET(fd, &rfds))



More information about the Uim-commit mailing list