diff options
author | Steve Dickson <steved@redhat.com> | 2014-11-17 13:17:20 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-11-17 13:18:14 -0500 |
commit | e725def62c73b4aa269fefc4c0d96abb41927fcb (patch) | |
tree | e78df60d2810405aebca36f482f7dbb7a4e75f1f /support/export/export.c | |
parent | 22656570c024e378baf66ca26fe2ab2bcc897129 (diff) | |
download | nfs-utils-e725def62c73b4aa269fefc4c0d96abb41927fcb.tar.gz nfs-utils-e725def62c73b4aa269fefc4c0d96abb41927fcb.tar.xz nfs-utils-e725def62c73b4aa269fefc4c0d96abb41927fcb.zip |
exportfs: Do not fail on empty exports file.
Commit 076dd80 introduced a regression that causes
exportfs to fail when there is an empty /etc/exports
file. A empty /etc/exports file is valid and should
not cause exportfs to fail.
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/export/export.c')
-rw-r--r-- | support/export/export.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/support/export/export.c b/support/export/export.c index ce714d4..30a5b4a 100644 --- a/support/export/export.c +++ b/support/export/export.c @@ -71,12 +71,13 @@ static void warn_duplicated_exports(nfs_export *exp, struct exportent *eep) * */ void -export_read(char *fname) +export_read(char *fname, int verbose) { struct exportent *eep; nfs_export *exp; int volumes = 0; + int bad_entry = 0; setexportent(fname, "r"); while ((eep = getexportent(0,1)) != NULL) { @@ -85,13 +86,19 @@ export_read(char *fname) exp = export_create(eep, 0); if (exp) volumes++; + else + bad_entry++; } else warn_duplicated_exports(exp, eep); } endexportent(); - if (volumes == 0) - xlog(L_ERROR, "No file systems exported!"); + if (volumes == 0) { + if (bad_entry > 0) + xlog(L_ERROR, "No file systems exported!"); + else if (verbose) + xlog(L_WARNING, "No file systems exported!"); + } } /** |