summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
477ac36)
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.
if (storefile) {
ssize_t sret;
if (storefile) {
ssize_t sret;
if ((storefd = open(storefile, O_RDONLY)) == -1) {
fprintf(stderr, "unable to open store file for read (%s), errno = %d\n", storefile, errno);
exit(1);
}
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);
if (sret < 0) {
fprintf(stderr, "unable to read store file (%s), errno = %d\n", storefile, errno);
exit(1);