From: Dean Roehrich Date: Fri, 27 May 2005 17:20:01 +0000 (+0000) Subject: fix write_invis, workaround irix compiler bug X-Git-Tag: v1.1.0~729 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a3d6ec627d55cc33f232430967fa779d86710695;p=users%2Fhch%2Fxfstests-dev.git 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. --- diff --git a/dmapi/src/common/cmd/write_invis.c b/dmapi/src/common/cmd/write_invis.c index d543c8d70..a28bdeee6 100644 --- a/dmapi/src/common/cmd/write_invis.c +++ b/dmapi/src/common/cmd/write_invis.c @@ -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);