Lines 179-184
Link Here
|
179 |
if(cur_timeout.tv_sec != -1){ |
179 |
if(cur_timeout.tv_sec != -1){ |
180 |
time_sous(&cur_timeout, ¤t_t, &timeout); |
180 |
time_sous(&cur_timeout, ¤t_t, &timeout); |
181 |
|
181 |
|
|
|
182 |
if (0 > timeout.tv_usec) { |
183 |
/* avoid EINVAL (paranoid) */ |
184 |
timeout.tv_sec -= (timeout.tv_usec / 1000000) + 1; |
185 |
timeout.tv_usec = (timeout.tv_usec % 1000000) + 1000000; |
186 |
} |
187 |
|
182 |
// prevent negative timeout |
188 |
// prevent negative timeout |
183 |
if(timeout.tv_sec < 0){ |
189 |
if(timeout.tv_sec < 0){ |
184 |
timeout.tv_usec = 0; |
190 |
timeout.tv_usec = 0; |
Lines 188-193
Link Here
|
188 |
timeout.tv_usec += 10000; |
194 |
timeout.tv_usec += 10000; |
189 |
tmout = &timeout; |
195 |
tmout = &timeout; |
190 |
|
196 |
|
|
|
197 |
if (1000000 <= timeout.tv_usec) { |
198 |
/* avoid EINVAL */ |
199 |
timeout.tv_sec += timeout.tv_usec / 1000000; |
200 |
timeout.tv_usec %= 1000000; |
201 |
} |
202 |
|
191 |
// if no timeout |
203 |
// if no timeout |
192 |
} else { |
204 |
} else { |
193 |
tmout = NULL; |
205 |
tmout = NULL; |