This patch switches libnfs over to use precompiled rpcgen files
and using ZDR. ZDR is a trivial reimplementation of XDR that is built in
into libnfs.
This removes the dependencies of rpc/xdr completely and allow us to build on any
system, even systems where rpcgen and librpc/libxdr are not generally available.
need to check that status is OK before we start dereferencing the 'export' pointers or else we will segv.
this could happen if trying to pull the list of exports from a host that does not have mountd running, or if we can not connect at all to the host.
when nfs_set_error is called with error_string being the result of a lower layer
problem so it is passed as "rpc_get_error()"
This meant that since free that nfs->rpc->error_string before we reference it a few lines further down in the vasprintf(..., error_string,
adn memory corruption triggers.
Valgrind found this, Valgrind rules!
a read can sometimes span beyond the end of file.
In which case individual smal read chunks beyond the end of file will return OK, 0 bytes of data and EOF==1
For this case, trap when len==0 and ignore these chunks.
Do not update the read-count if / when len is 0.