Differences From Artifact [ea4c0fa50a]:
- File
src/OFProcess.m
— part of check-in
[f9cd4f9cab]
at
2017-06-05 15:51:48
on branch trunk
— OFStream: Don't throw when at end of stream
Instead, let reads return 0 and let writes append after the end. (user: js, size: 14093) [annotate] [blame] [check-ins using]
To Artifact [a980832db2]:
- File
src/OFProcess.m
— part of check-in
[4f36894ce7]
at
2017-06-05 17:36:28
on branch trunk
— Clean up exceptions a little
This removes several initializers that omitted the errNo. Removing those
forces to think about whether there is a meaningful errNo to set instead
of just omitting it. (user: js, size: 14117) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
469 470 471 472 473 474 475 |
if (!ReadFile(_readPipe[0], buffer, (DWORD)length, &ret, NULL)) {
if (GetLastError() == ERROR_BROKEN_PIPE) {
_atEndOfStream = true;
return 0;
}
@throw [OFReadFailedException exceptionWithObject: self
| | > | 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
if (!ReadFile(_readPipe[0], buffer, (DWORD)length, &ret, NULL)) {
if (GetLastError() == ERROR_BROKEN_PIPE) {
_atEndOfStream = true;
return 0;
}
@throw [OFReadFailedException exceptionWithObject: self
requestedLength: length
errNo: EIO];
}
#endif
if (ret == 0)
_atEndOfStream = true;
return ret;
|
| ︙ | ︙ | |||
504 505 506 507 508 509 510 |
@throw [OFOutOfRangeException exception];
if (_writePipe[1] == NULL)
@throw [OFNotOpenException exceptionWithObject: self];
if (!WriteFile(_writePipe[1], buffer, (DWORD)length, &ret, NULL) ||
ret != (DWORD)length) {
| | | 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
@throw [OFOutOfRangeException exception];
if (_writePipe[1] == NULL)
@throw [OFNotOpenException exceptionWithObject: self];
if (!WriteFile(_writePipe[1], buffer, (DWORD)length, &ret, NULL) ||
ret != (DWORD)length) {
int errNo = EIO;
if (GetLastError() == ERROR_BROKEN_PIPE)
errNo = EPIPE;
@throw [OFWriteFailedException exceptionWithObject: self
requestedLength: length
errNo: errNo];
|
| ︙ | ︙ |