ObjFW  Diff

Differences From Artifact [651ec2f405]:

To Artifact [80091b13c1]:


436
437
438
439
440
441
442


443
444
445
446
447
448
449

	if ((uint64_t)length > _toWrite)
		@throw [OFOutOfRangeException exception];

	@try {
		[_stream writeBuffer: buffer length: length];
	} @catch (OFWriteFailedException *e) {


		_toWrite -= e.bytesWritten;

		if (e.errNo == EWOULDBLOCK)
			return e.bytesWritten;

		@throw e;
	}







>
>







436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451

	if ((uint64_t)length > _toWrite)
		@throw [OFOutOfRangeException exception];

	@try {
		[_stream writeBuffer: buffer length: length];
	} @catch (OFWriteFailedException *e) {
		OFEnsure(e.bytesWritten <= length);

		_toWrite -= e.bytesWritten;

		if (e.errNo == EWOULDBLOCK)
			return e.bytesWritten;

		@throw e;
	}