summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/export/export.c20
-rw-r--r--support/include/exportfs.h2
2 files changed, 8 insertions, 14 deletions
diff --git a/support/export/export.c b/support/export/export.c
index 30a5b4a..e1bebce 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -69,36 +69,30 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep)
* export_read - read entries from /etc/exports
* @fname: name of file to read from
*
+ * Returns number of read entries.
*/
-void
-export_read(char *fname, int verbose)
+int
+export_read(char *fname)
{
struct exportent *eep;
nfs_export *exp;
int volumes = 0;
- int bad_entry = 0;
setexportent(fname, "r");
while ((eep = getexportent(0,1)) != NULL) {
exp = export_lookup(eep->e_hostname, eep->e_path, 0);
if (!exp) {
- exp = export_create(eep, 0);
- if (exp)
+ if (export_create(eep, 0))
+ /* possible complaints already logged */
volumes++;
- else
- bad_entry++;
}
else
warn_duplicated_exports(exp, eep);
}
endexportent();
- if (volumes == 0) {
- if (bad_entry > 0)
- xlog(L_ERROR, "No file systems exported!");
- else if (verbose)
- xlog(L_WARNING, "No file systems exported!");
- }
+
+ return volumes;
}
/**
diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index 3d89f12..3b92f04 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -133,7 +133,7 @@ struct addrinfo * client_resolve(const struct sockaddr *sap);
int client_member(const char *client,
const char *name);
-void export_read(char *fname, int verbose);
+int export_read(char *fname);
void export_reset(nfs_export *);
nfs_export * export_lookup(char *hname, char *path, int caconical);
nfs_export * export_find(const struct addrinfo *ai,