X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fnfs-cp.c;h=eeea40423790d2b5b2ace872e76545f583db45b7;hb=3d574b1eab581b59afce94a85853ec47e7ef404e;hp=53e22d60209db560fa555fc1b1d09c4a1f663741;hpb=a6bc1707f7acebfd6cf1061cf0cd7e7dc57878ce;p=deb_libnfs.git diff --git a/examples/nfs-cp.c b/examples/nfs-cp.c index 53e22d6..eeea404 100644 --- a/examples/nfs-cp.c +++ b/examples/nfs-cp.c @@ -96,7 +96,8 @@ static int64_t file_pread(struct file_context *fc, char *buf, int64_t count, uint64_t off) { if (fc->is_nfs == 0) { - return pread(fc->fd, buf, count, off); + lseek(fc->fd, off, SEEK_SET); + return read(fc->fd, buf, count); } else { return nfs_pread(fc->nfs, fc->nfsfh, off, count, buf); } @@ -106,7 +107,8 @@ static int64_t file_pwrite(struct file_context *fc, char *buf, int64_t count, uint64_t off) { if (fc->is_nfs == 0) { - return pwrite(fc->fd, buf, count, off); + lseek(fc->fd, off, SEEK_SET); + return write(fc->fd, buf, count); } else { return nfs_pwrite(fc->nfs, fc->nfsfh, off, count, buf); }