};
+ void PrintServerList()
+ {
+ struct nfs_server_list *srvrs;
+ struct nfs_server_list *srv;
+
+ srvrs = nfs_find_local_servers();
+
+ for (srv=srvrs; srv; srv = srv->next)
+ {
+ printf("Found nfs server: %s\n", srv->addr);
+
+ }
+ free_nfs_srvr_list(srvrs);
+ }
+
char buf[3*1024*1024+337];
int main(int argc _U_, char *argv[] _U_)
client.server = SERVER;
client.export = EXPORT;
client.is_finished = 0;
+
+ PrintServerList();
+
export = mount_getexports(SERVER);
if (export != NULL) {
printf("exports on server %s\n", SERVER);
while((nfsdirent = nfs_readdir(nfs, nfsdir)) != NULL) {
char filename[1024];
printf("Inode:%d Name:%s ", (int)nfsdirent->inode, nfsdirent->name);
- sprintf(&filename, "%s/%s", NFSDIR, nfsdirent->name);
+ sprintf(filename, "%s/%s", NFSDIR, nfsdirent->name);
ret = nfs_open(nfs, filename, O_RDONLY, &nfsfh);
if (ret != 0) {
printf("Failed to open(%s) %s\n", filename, nfs_get_error(nfs));
ret = nfs_read(nfs, nfsfh, sizeof(buf), buf);
if (ret < 0) {
printf("Error reading file\n");
- exit(10);
}
printf("Read %d bytes\n", ret);
ret = nfs_close(nfs, nfsfh);