Mercurial > MadButterfly
diff 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 |
line wrap: on
line diff
--- a/src/X_supp.c Sun Sep 14 21:08:25 2008 +0800 +++ b/src/X_supp.c Sun Sep 14 23:05:30 2008 +0800 @@ -196,7 +196,7 @@ struct timeval tv; fd_set rfds; int nfds; - int r; + int r, r1; rdman_redraw_all(rdman); XFlush(display); @@ -213,16 +213,16 @@ if(r == 0) { tv.tv_sec = MB_TIMEVAL_SEC(&tmo); tv.tv_usec = MB_TIMEVAL_USEC(&tmo); - r = select(nfds, &rfds, NULL, NULL, &tv); + r1 = select(nfds, &rfds, NULL, NULL, &tv); } else - r = select(nfds, &rfds, NULL, NULL, NULL); + r1 = select(nfds, &rfds, NULL, NULL, NULL); - if(r == -1) { + if(r1 == -1) { perror("select"); break; } - if(r == 0) { + if(r1 == 0) { get_now(&now); mb_tman_handle_timeout(tman, &now); rdman_redraw_changed(rdman);