Overview
Comment: | Check the value of read/write in OFStreamObserver.
Some systems like Ubuntu have libc headers which specify an attribute |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8349bc4bbe0baf3ca50042c050f24ea9 |
User & Date: | js on 2011-04-04 23:32:10 |
Other Links: | manifest | tags |
Context
2011-04-04
| ||
23:32 | Remove now useless defines of _GNU_SOURCE. check-in: 93fee7265f user: js tags: trunk | |
23:32 | Check the value of read/write in OFStreamObserver. check-in: 8349bc4bbe user: js tags: trunk | |
23:31 | Use -std=gnu99 instead of -std=c99. c99 gives trouble with glibc. check-in: 70e82fef45 user: js tags: trunk | |
Changes
Modified src/OFStreamObserver.m from [b3c7d0cf87] to [c4fa7336ee].
︙ | ︙ | |||
216 217 218 219 220 221 222 | OFNumber *qi = [OFNumber numberWithInt: QUEUE_ADD | QUEUE_READ]; @synchronized (queue) { [queue addObject: stream]; [queueInfo addObject: qi]; } | | | | | | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | OFNumber *qi = [OFNumber numberWithInt: QUEUE_ADD | QUEUE_READ]; @synchronized (queue) { [queue addObject: stream]; [queueInfo addObject: qi]; } assert(!write(cancelFd[1], "", 1)); [pool release]; } - (void)addStreamToObserveForWriting: (OFStream*)stream { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFNumber *qi = [OFNumber numberWithInt: QUEUE_ADD | QUEUE_WRITE]; @synchronized (queue) { [queue addObject: stream]; [queueInfo addObject: qi]; } assert(!write(cancelFd[1], "", 1)); [pool release]; } - (void)removeStreamToObserveForReading: (OFStream*)stream { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFNumber *qi = [OFNumber numberWithInt: QUEUE_REMOVE | QUEUE_READ]; @synchronized (queue) { [queue addObject: stream]; [queueInfo addObject: qi]; } assert(!write(cancelFd[1], "", 1)); [pool release]; } - (void)removeStreamToObserveForWriting: (OFStream*)stream { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFNumber *qi = [OFNumber numberWithInt: QUEUE_REMOVE | QUEUE_WRITE]; @synchronized (queue) { [queue addObject: stream]; [queueInfo addObject: qi]; } assert(!write(cancelFd[1], "", 1)); [pool release]; } - (void)_processQueue { @synchronized (queue) { |
︙ | ︙ | |||
390 391 392 393 394 395 396 | OFNumber *num; OFStream *stream; if (fds_c[i].revents & POLLIN) { if (fds_c[i].fd == cancelFd[0]) { char buf; | | | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | OFNumber *num; OFStream *stream; if (fds_c[i].revents & POLLIN) { if (fds_c[i].fd == cancelFd[0]) { char buf; assert(!read(cancelFd[0], &buf, 1)); fds_c[i].revents = 0; continue; } num = [OFNumber numberWithInt: fds_c[i].fd]; stream = [fdToStream objectForKey: num]; |
︙ | ︙ | |||
435 436 437 438 439 440 441 | if (select(nfds, &readfds_, &writefds_, &exceptfds_, (timeout != -1 ? &tv : NULL)) < 1) return NO; if (FD_ISSET(cancelFd[0], &readfds_)) { char buf; | | | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | if (select(nfds, &readfds_, &writefds_, &exceptfds_, (timeout != -1 ? &tv : NULL)) < 1) return NO; if (FD_ISSET(cancelFd[0], &readfds_)) { char buf; assert(!read(cancelFd[0], &buf, 1)); } for (i = 0; i < count; i++) { int fd = [cArray[i] fileDescriptor]; if (FD_ISSET(fd, &readfds_)) { [delegate streamDidBecomeReadyForReading: cArray[i]]; |
︙ | ︙ |