Differences From Artifact [f904878755]:
- File src/OFStreamObserver_select.m — part of check-in [e40729d406] at 2013-02-12 18:22:15 on branch trunk — Prefix all ivars with an underscore. (user: js, size: 4095) [annotate] [blame] [check-ins using]
To Artifact [0d55873c55]:
- File
src/OFStreamObserver_select.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 4103) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
67 68 69 70 71 72 73 | { FD_CLR(fd, &_writeFDs); if (!FD_ISSET(fd, &_readFDs)) FD_CLR(fd, &_exceptFDs); } | | | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | { FD_CLR(fd, &_writeFDs); if (!FD_ISSET(fd, &_readFDs)) FD_CLR(fd, &_exceptFDs); } - (bool)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); OFStream **objects; fd_set readFDs; fd_set writeFDs; fd_set exceptFDs; struct timeval time; size_t i, count, realEvents = 0; [self OF_processQueue]; if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return true; } objc_autoreleasePoolPop(pool); #ifdef FD_COPY FD_COPY(&_readFDs, &readFDs); FD_COPY(&_writeFDs, &writeFDs); |
︙ | ︙ | |||
107 108 109 110 111 112 113 | * satisfy the required range, we just cast to int. */ time.tv_sec = (time_t)timeout; time.tv_usec = (int)((timeout - time.tv_sec) * 1000); if (select((int)_maxFD + 1, &readFDs, &writeFDs, &exceptFDs, (timeout != -1 ? &time : NULL)) < 1) | | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | * satisfy the required range, we just cast to int. */ time.tv_sec = (time_t)timeout; time.tv_usec = (int)((timeout - time.tv_sec) * 1000); if (select((int)_maxFD + 1, &readFDs, &writeFDs, &exceptFDs, (timeout != -1 ? &time : NULL)) < 1) return false; if (FD_ISSET(_cancelFD[0], &readFDs)) { char buffer; #ifndef _WIN32 OF_ENSURE(read(_cancelFD[0], &buffer, 1) > 0); #else OF_ENSURE(recvfrom(_cancelFD[0], &buffer, 1, 0, NULL, |
︙ | ︙ | |||
182 183 184 185 186 187 188 | realEvents++; } objc_autoreleasePoolPop(pool); } if (realEvents == 0) | | | | 182 183 184 185 186 187 188 189 190 191 192 193 | realEvents++; } objc_autoreleasePoolPop(pool); } if (realEvents == 0) return false; return true; } @end |