X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fnfsclient-sync.c;h=d4f6b0c0226fdc18285ce0c2fc10c67db253c71e;hb=e4a5ba42b8212574a6c75ac518e7b3be6e619a5b;hp=93704431d2d8f5aa7383d26346ae7934385059f2;hpb=e210bd2af80d4817e6debf48192ba685c6620864;p=deb_libnfs.git diff --git a/examples/nfsclient-sync.c b/examples/nfsclient-sync.c index 9370443..d4f6b0c 100644 --- a/examples/nfsclient-sync.c +++ b/examples/nfsclient-sync.c @@ -20,7 +20,7 @@ #define SERVER "10.1.1.27" #define EXPORT "/VIRTUAL" -#define NFSFILE "/BOOKS/Classics/Dracula.djvu" +#define NFSFILE "/BOOKS/Classics/Dracula.djvu.truncated" #define NFSFILER "/BOOKS/Classics/Dracula.djvu.renamed" #define NFSFILEW "/BOOKS/Classics/foo" #define NFSDIR "/BOOKS/Classics/" @@ -46,6 +46,8 @@ struct client { }; +char buf[5*1024*1024]; + int main(int argc _U_, char *argv[] _U_) { struct nfs_context *nfs; @@ -58,7 +60,6 @@ int main(int argc _U_, char *argv[] _U_) client.server = SERVER; client.export = EXPORT; client.is_finished = 0; - char buf[16]; off_t offset; struct statvfs svfs; exports export, tmp; @@ -102,6 +103,7 @@ int main(int argc _U_, char *argv[] _U_) exit(10); } +#if 0 ret = nfs_read(nfs, nfsfh, 16, buf); if (ret < 0) { printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs)); @@ -112,7 +114,8 @@ int main(int argc _U_, char *argv[] _U_) printf("%02x ", buf[i]&0xff); } printf("\n"); - ret = nfs_read(nfs, nfsfh, 16, buf); +#endif + ret = nfs_read(nfs, nfsfh, sizeof(buf), buf); if (ret < 0) { printf("Failed to pread(%s) %s\n", NFSFILE, nfs_get_error(nfs)); exit(10);