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

Comparing gvpe/src/iom.C (file contents):
Revision 1.25 by pcg, Sun Nov 14 22:47:00 2004 UTC vs.
Revision 1.26 by pcg, Wed Dec 15 02:59:54 2004 UTC

94 } tw0; 94 } tw0;
95 95
96tstamp NOW; 96tstamp NOW;
97 97
98#if IOM_TIME 98#if IOM_TIME
99inline void set_now (void) 99tstamp io_manager::now ()
100{ 100{
101 struct timeval tv; 101 struct timeval tv;
102 102
103 gettimeofday (&tv, 0); 103 gettimeofday (&tv, 0);
104 NOW = (tstamp)tv.tv_sec + (tstamp)tv.tv_usec / 1000000.; 104 return (tstamp)tv.tv_sec + (tstamp)tv.tv_usec / 1000000.;
105}
106
107void io_manager::set_now ()
108{
109 NOW = now ();
105} 110}
106#endif 111#endif
107 112
108static bool iom_valid; 113static bool iom_valid;
109 114
118 { 123 {
119 perror ("io_manager: unable to create signal pipe, aborting."); 124 perror ("io_manager: unable to create signal pipe, aborting.");
120 abort (); 125 abort ();
121 } 126 }
122 127
123 fcntl (sigpipe[0], F_SETFL, O_NONBLOCK); 128 fcntl (sigpipe[0], F_SETFL, O_NONBLOCK); fcntl (sigpipe[0], F_SETFD, FD_CLOEXEC);
124 fcntl (sigpipe[1], F_SETFL, O_NONBLOCK); 129 fcntl (sigpipe[1], F_SETFL, O_NONBLOCK); fcntl (sigpipe[1], F_SETFD, FD_CLOEXEC);
125#endif 130#endif
126 131
127 iom_valid = true; 132 iom_valid = true;
128 133
129#if IOM_TIME 134#if IOM_TIME
130 set_now (); 135 io_manager::set_now ();
131 136
132 tw0.start (TSTAMP_MAX); 137 tw0.start (TSTAMP_MAX);
133#endif 138#endif
134 } 139 }
135 140

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines