X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fnfsclient-sync.c;h=a5af3ce73d19c40db030337eb33a8c05ad94b998;hb=739df145d600a7beb21050a5cb95b6b7ae184934;hp=521bf4e1fa5a5d2c3dfdb6e6f3787bf51383b48e;hpb=1e8994af0fde29bb03c52c5c4a972ef8d8ddbc33;p=deb_libnfs.git diff --git a/examples/nfsclient-sync.c b/examples/nfsclient-sync.c index 521bf4e..a5af3ce 100644 --- a/examples/nfsclient-sync.c +++ b/examples/nfsclient-sync.c @@ -64,15 +64,19 @@ int main(int argc _U_, char *argv[] _U_) struct statvfs svfs; exports export, tmp; - printf("exports on server %s\n", SERVER); export = mount_getexports(SERVER); - tmp = export; - while (tmp != NULL) { - printf("Export: %s\n", tmp->ex_dir); - tmp = tmp->ex_next; - } - mount_free_export_list(export); - + if (export != NULL) { + printf("exports on server %s\n", SERVER); + tmp = export; + while (tmp != NULL) { + printf("Export: %s\n", tmp->ex_dir); + tmp = tmp->ex_next; + } + + mount_free_export_list(export); + } else { + printf("no exports on server %s\n", SERVER); + } nfs = nfs_init_context(); if (nfs == NULL) {