mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fix write_invis, workaround irix compiler bug
Do not lseek--no reason for it. Workaround irix compiler bug, I think, by using a temp variable for the read() length...the irix compiler kept inserting a value of zero for the length.
This commit is contained in:
@@ -157,19 +157,15 @@ main(
|
||||
|
||||
if (storefile) {
|
||||
ssize_t sret;
|
||||
off_t lret;
|
||||
size_t len;
|
||||
|
||||
if ((storefd = open(storefile, O_RDONLY)) == -1) {
|
||||
fprintf(stderr, "unable to open store file for read (%s), errno = %d\n", storefile, errno);
|
||||
exit(1);
|
||||
}
|
||||
lret = lseek(storefd, offset, SEEK_SET);
|
||||
if (lret < 0) {
|
||||
fprintf(stderr, "unable to lseek(%s) to offset %lld, errno = %d\n",
|
||||
storefile, (long long)lret, errno);
|
||||
exit(1);
|
||||
}
|
||||
sret = read(storefd, bufp, length);
|
||||
|
||||
len = length;
|
||||
sret = read(storefd, bufp, len);
|
||||
if (sret < 0) {
|
||||
fprintf(stderr, "unable to read store file (%s), errno = %d\n", storefile, errno);
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user