ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/iom.C
(Generate patch)

Comparing rxvt-unicode/src/iom.C (file contents):
Revision 1.13 by pcg, Sun Feb 1 01:34:41 2004 UTC vs.
Revision 1.15 by pcg, Sun Mar 28 02:07:08 2004 UTC

21#include <cstdlib> 21#include <cstdlib>
22#include <cerrno> 22#include <cerrno>
23 23
24#include <sys/time.h> 24#include <sys/time.h>
25 25
26#if 1 // older unices need these includes for select(2) 26#if 1 // older unices need these includes for select (2)
27# include <unistd.h> 27# include <unistd.h>
28# include <sys/types.h> 28# include <sys/types.h>
29#endif 29#endif
30 30
31// if the BSDs would at least be marginally POSIX-compatible.. *sigh* 31// if the BSDs would at least be marginally POSIX-compatible.. *sigh*
49 // reached end-of-time, or tstamp has a bogus definition, 49 // reached end-of-time, or tstamp has a bogus definition,
50 // or compiler initilization order broken, or somethine else :) 50 // or compiler initilization order broken, or somethine else :)
51 abort (); 51 abort ();
52 } 52 }
53 53
54 tw0() 54 tw0 ()
55 : time_watcher (this, &tw0::cb) 55 : time_watcher (this, &tw0::cb)
56 { }} 56 { }}
57tw0; 57tw0;
58 58
59tstamp NOW; 59tstamp NOW;
166 { 166 {
167 if (next != tw[0]) 167 if (next != tw[0])
168 { 168 {
169 double diff = next->at - NOW; 169 double diff = next->at - NOW;
170 tval.tv_sec = (int)diff; 170 tval.tv_sec = (int)diff;
171 tval.tv_usec = (int)((diff - tval.tv_sec) * 1000000); 171 tval.tv_usec = (int) ((diff - tval.tv_sec) * 1000000);
172 to = &tval; 172 to = &tval;
173 } 173 }
174 break; 174 break;
175 } 175 }
176 else 176 else
199 to = &tval; 199 to = &tval;
200 } 200 }
201#endif 201#endif
202 202
203#if IOM_IO 203#if IOM_IO
204 fd_set rfd, wfd, efd; 204 fd_set rfd, wfd;
205 205
206 FD_ZERO (&rfd); 206 FD_ZERO (&rfd);
207 FD_ZERO (&wfd); 207 FD_ZERO (&wfd);
208 208
209 int fds = 0; 209 int fds = 0;
218 } 218 }
219 219
220 if (!to && !fds) //TODO: also check idle_watchers and check_watchers 220 if (!to && !fds) //TODO: also check idle_watchers and check_watchers
221 break; // no events 221 break; // no events
222 222
223 fds = select (fds, &rfd, &wfd, &efd, to); 223 fds = select (fds, &rfd, &wfd, NULL, to);
224# if IOM_TIME 224# if IOM_TIME
225 set_now (); 225 set_now ();
226# endif 226# endif
227 227
228 if (fds > 0) 228 if (fds > 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines