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:
Dean Roehrich
2005-05-27 17:20:01 +00:00
parent 477ac36824
commit a3d6ec627d
+4 -8
View File
@@ -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);