ObjFW  Diff

Differences From Artifact [d71ec31613]:

To Artifact [fc04feb323]:


466
467
468
469
470
471
472
473

474
475
476
477
478
479
480
481
482
483
484
485
486
487

488
489
490
491
492
493
494
466
467
468
469
470
471
472

473
474
475
476
477
478
479
480
481
482
483
484
485
486

487
488
489
490
491
492
493
494







-
+













-
+







- (size_t)_readNBytes: (size_t)size
	   intoBuffer: (char*)buf
{
	size_t ret;

	if (fd == -1 || eos)
		@throw [OFReadFailedException newWithClass: isa
						      size: size];
					     requestedSize: size];
	if ((ret = read(fd, buf, size)) == 0)
		eos = YES;

	return ret;
}

- (size_t)_writeNBytes: (size_t)size
	    fromBuffer: (const char*)buf
{
	size_t ret;

	if (fd == -1 || eos || (ret = write(fd, buf, size)) < size)
		@throw [OFWriteFailedException newWithClass: isa
						       size: size];
					      requestedSize: size];

	return ret;
}

- (void)_seekToOffset: (off_t)offset
{
	if (lseek(fd, offset, SEEK_SET) == -1)