shithub: gefs

Download patch

ref: 6caee0300e6e8e51551a6a277ef4c6c9113982ff
parent: deeb8ec05b7b0b9d493ee90258b22f4bc7f4aaa6
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Nov 3 18:26:23 EDT 2023

freplay: use int-sized lengths for read

--- a/test/freplay.c
+++ b/test/freplay.c
@@ -158,8 +158,8 @@
 		sysfatal("failed to allocate buffer: %r");
 	memset(membuf, 0, d->length);
 	for(off = 0; off < d->length; off += n)
-		if((n = read(fd, membuf+off, d->length - off)) <= 0)
-			sysfatal("read %s: short read", argv[0]);
+		if((n = read(fd, membuf+off, IOUNIT)) <= 0)
+			sysfatal("read %s@%lld: short read: %r", argv[0], off);
 	membufsz = d->length;
 	free(d);
 	if(replayfile != nil){