kernel/qcore_unix.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3static inline bool time_update(struct timeval *tv, const struct timeval &start, -
4 const struct timeval &timeout) -
5{ -
6 if (!QElapsedTimer::isMonotonic()) {
partially evaluated: !QElapsedTimer::isMonotonic()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180
0-180
7 -
8 return false;
never executed: return false;
0
9 } -
10 -
11 -
12 struct timeval now = qt_gettime(); -
13 *tv = timeout + start - now; -
14 return tv->tv_sec >= 0;
executed: return tv->tv_sec >= 0;
Execution Count:180
180
15} -
16 -
17int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, -
18 const struct timeval *orig_timeout) -
19{ -
20 if (!orig_timeout) {
evaluated: !orig_timeout
TRUEFALSE
yes
Evaluation Count:11214
yes
Evaluation Count:60939
11214-60939
21 -
22 register int ret; -
23 do { ret = select(nfds, fdread, fdwrite, fdexcept, 0); } while (ret == -1 && (*__errno_location ()) == 4);
evaluated: ret == -1
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:11214
partially evaluated: (*__errno_location ()) == 4
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
executed: }
Execution Count:11217
0-11217
24 return ret;
executed: return ret;
Execution Count:11214
11214
25 } -
26 -
27 timeval start = qt_gettime(); -
28 timeval timeout = *orig_timeout; -
29 -
30 -
31 int ret; -
32 for(;;) { -
33 ret = ::select(nfds, fdread, fdwrite, fdexcept, &timeout); -
34 if (ret != -1 || (*__errno_location ()) != 4)
evaluated: ret != -1
TRUEFALSE
yes
Evaluation Count:60942
yes
Evaluation Count:180
partially evaluated: (*__errno_location ()) != 4
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180
0-60942
35 return ret;
executed: return ret;
Execution Count:60942
60942
36 -
37 -
38 if (!time_update(&timeout, start, *orig_timeout)) {
partially evaluated: !time_update(&timeout, start, *orig_timeout)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180
0-180
39 -
40 -
41 return 0;
never executed: return 0;
0
42 } -
43 }
executed: }
Execution Count:180
180
44}
never executed: }
0
45 -
46 -
47 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial