Mercurial > MadButterfly
comparison src/X_supp.c @ 120:5df7403b6fbc
Fix bug of get_now()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 14 Sep 2008 23:05:30 +0800 |
parents | 42698de1f653 |
children | 17e97e92b76e |
comparison
equal
deleted
inserted
replaced
119:257a1d314bcd | 120:5df7403b6fbc |
---|---|
194 int fd; | 194 int fd; |
195 mb_timeval_t now, tmo; | 195 mb_timeval_t now, tmo; |
196 struct timeval tv; | 196 struct timeval tv; |
197 fd_set rfds; | 197 fd_set rfds; |
198 int nfds; | 198 int nfds; |
199 int r; | 199 int r, r1; |
200 | 200 |
201 rdman_redraw_all(rdman); | 201 rdman_redraw_all(rdman); |
202 XFlush(display); | 202 XFlush(display); |
203 | 203 |
204 fd = XConnectionNumber(display); | 204 fd = XConnectionNumber(display); |
211 r = mb_tman_next_timeout(tman, &now, &tmo); | 211 r = mb_tman_next_timeout(tman, &now, &tmo); |
212 | 212 |
213 if(r == 0) { | 213 if(r == 0) { |
214 tv.tv_sec = MB_TIMEVAL_SEC(&tmo); | 214 tv.tv_sec = MB_TIMEVAL_SEC(&tmo); |
215 tv.tv_usec = MB_TIMEVAL_USEC(&tmo); | 215 tv.tv_usec = MB_TIMEVAL_USEC(&tmo); |
216 r = select(nfds, &rfds, NULL, NULL, &tv); | 216 r1 = select(nfds, &rfds, NULL, NULL, &tv); |
217 } else | 217 } else |
218 r = select(nfds, &rfds, NULL, NULL, NULL); | 218 r1 = select(nfds, &rfds, NULL, NULL, NULL); |
219 | 219 |
220 if(r == -1) { | 220 if(r1 == -1) { |
221 perror("select"); | 221 perror("select"); |
222 break; | 222 break; |
223 } | 223 } |
224 | 224 |
225 if(r == 0) { | 225 if(r1 == 0) { |
226 get_now(&now); | 226 get_now(&now); |
227 mb_tman_handle_timeout(tman, &now); | 227 mb_tman_handle_timeout(tman, &now); |
228 rdman_redraw_changed(rdman); | 228 rdman_redraw_changed(rdman); |
229 XFlush(display); | 229 XFlush(display); |
230 } else if(FD_ISSET(fd, &rfds)){ | 230 } else if(FD_ISSET(fd, &rfds)){ |