ObjFW  Diff

Differences From Artifact [fac79ea11f]:

To Artifact [ed0f11c59f]:


204
205
206
207
208
209
210
211


212
213
214
215
216
217
218
204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
219







-
+
+







		@throw [OFNotOpenException exceptionWithObject: self];

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

	if ((ret = Read(_handle, buffer, length)) < 0)
		@throw [OFReadFailedException exceptionWithObject: self
						  requestedLength: length];
						  requestedLength: length
							    errNo: EIO];
#endif

	if (ret == 0)
		_atEndOfStream = true;

	return ret;
}
246
247
248
249
250
251
252
253


254
255
256
257
258
259
260
247
248
249
250
251
252
253

254
255
256
257
258
259
260
261
262







-
+
+







		@throw [OFNotOpenException exceptionWithObject: self];

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

	if (Write(_handle, (void *)buffer, length) != (LONG)length)
		@throw [OFWriteFailedException exceptionWithObject: self
						   requestedLength: length];
						   requestedLength: length
							     errNo: EIO];
#endif
}

#if !defined(OF_WINDOWS) && !defined(OF_MORPHOS)
- (int)fileDescriptorForReading
{
	return _fd;