Fatal error is only when cannot open any of the given exports files.

This commit is contained in:
pjd 2007-04-13 10:25:49 +00:00
parent aa9e6582b9
commit 1a9b4ef000

View File

@ -1202,6 +1202,7 @@ get_exportlist()
char errmsg[255]; char errmsg[255];
int dirplen, num, i; int dirplen, num, i;
int iovlen; int iovlen;
int done;
bzero(&export, sizeof(export)); bzero(&export, sizeof(export));
export.ex_flags = MNT_DELEXPORT; export.ex_flags = MNT_DELEXPORT;
@ -1304,15 +1305,21 @@ get_exportlist()
* Read in the exports file and build the list, calling * Read in the exports file and build the list, calling
* nmount() as we go along to push the export rules into the kernel. * nmount() as we go along to push the export rules into the kernel.
*/ */
done = 0;
for (i = 0; exnames[i] != NULL; i++) { for (i = 0; exnames[i] != NULL; i++) {
if (debug) if (debug)
warnx("reading exports from %s", exnames[i]); warnx("reading exports from %s", exnames[i]);
if ((exp_file = fopen(exnames[i], "r")) == NULL) { if ((exp_file = fopen(exnames[i], "r")) == NULL) {
syslog(LOG_ERR, "can't open %s", exnames[i]); syslog(LOG_WARNING, "can't open %s", exnames[i]);
exit(2); continue;
} }
get_exportlist_one(); get_exportlist_one();
fclose(exp_file); fclose(exp_file);
done++;
}
if (done == 0) {
syslog(LOG_ERR, "can't open any exports file");
exit(2);
} }
} }