X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fcache.c;fp=utils%2Fmountd%2Fcache.c;h=8280234ac4fcbcb4eadc9ce9f98d9c04977b7e14;hp=457fc9c9d1ac9f7aa42c823504188896c0839686;hb=dbc0b5e878b44383cafbefdeb333177ca4a0c295;hpb=9fae1474f1f79c2c7f222a40dff6d3d4681a9115 diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 457fc9c..8280234 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -1109,11 +1109,24 @@ static struct exportent *lookup_junction(char *dom, const char *pathname, (void)dlclose(handle); return exp; } + +static void lookup_nonexport(FILE *f, char *dom, char *path, + struct addrinfo *ai) +{ + struct exportent *eep; + + eep = lookup_junction(dom, path, ai); + dump_to_cache(f, dom, path, eep); + if (eep == NULL) + return; + exportent_release(eep); + free(eep); +} #else /* !HAVE_NFS_PLUGIN_H */ -static inline struct exportent *lookup_junction(char *UNUSED(dom), - const char *UNUSED(pathname), struct addrinfo *UNUSED(ai)) +static void lookup_nonexport(FILE *f, char *dom, char *path, + struct addrinfo *UNUSED(ai)) { - return NULL; + dump_to_cache(f, dom, path, NULL); } #endif /* !HAVE_NFS_PLUGIN_H */ @@ -1164,16 +1177,9 @@ static void nfsd_export(FILE *f) " or fsid= required", path); dump_to_cache(f, dom, path, NULL); } - } else { - struct exportent *eep; - - eep = lookup_junction(dom, path, ai); - dump_to_cache(f, dom, path, eep); - if (eep != NULL) { - exportent_release(eep); - free(eep); - } - } + } else + lookup_nonexport(f, dom, path, ai); + out: xlog(D_CALL, "nfsd_export: found %p path %s", found, path ? path : NULL); if (dom) free(dom);