Differences From Artifact [996f83c1ba]:
- File src/OFStream.m — part of check-in [ff8b2a6c29] at 2012-07-16 22:44:23 on branch trunk — Don't require extra parentheses for OF_(UN)LIKELY. (user: js, size: 26542) [annotate] [blame] [check-ins using]
To Artifact [6992f1ccb5]:
- File
src/OFStream.m
— part of check-in
[440e95fd4a]
at
2012-09-12 17:27:53
on branch trunk
— Split -[OFStream fileDescriptor].
It is now -[fileDescriptorForReading] and -[fileDescriptorForWriting].
The split was necessary as some stream types (e.g. OFProcess) don't have
a single file descriptor, but two. This allows to use those stream types
with OFStreamObserver as well. (user: js, size: 26949) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
1360 1361 1362 1363 1364 1365 1366 | { return blocking; } - (void)setBlocking: (BOOL)enable { #ifndef _WIN32 | | | > | | | > | | > | > | > | > > > > > > | 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 | { return blocking; } - (void)setBlocking: (BOOL)enable { #ifndef _WIN32 int readFlags, writeFlags; readFlags = fcntl([self fileDescriptorForReading], F_GETFL); writeFlags = fcntl([self fileDescriptorForWriting], F_GETFL); if (readFlags == -1 || writeFlags == -1) @throw [OFSetOptionFailedException exceptionWithClass: [self class] stream: self]; if (enable) { readFlags &= ~O_NONBLOCK; writeFlags &= ~O_NONBLOCK; } else { readFlags |= O_NONBLOCK; writeFlags |= O_NONBLOCK; } if (fcntl([self fileDescriptorForReading], F_SETFL, readFlags) == -1 || fcntl([self fileDescriptorForWriting], F_SETFL, writeFlags) == -1) @throw [OFSetOptionFailedException exceptionWithClass: [self class] stream: self]; #else @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; #endif } - (int)fileDescriptorForReading { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (int)fileDescriptorForWriting { @throw [OFNotImplementedException exceptionWithClass: [self class] selector: _cmd]; } - (void)close { |
︙ | ︙ |