diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-05-29 17:46:52 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-05-29 17:46:52 +0000 |
commit | fdb42dd4bf429f38a9ffc635d5c04d380f354ee6 (patch) | |
tree | dbc9f4175b63c19230cbb7323800b5d9bd931cb3 /sbin | |
parent | bd38254e2edd7d3cf7daf140496f3e44ff42a3e7 (diff) | |
download | FreeBSD-src-fdb42dd4bf429f38a9ffc635d5c04d380f354ee6.zip FreeBSD-src-fdb42dd4bf429f38a9ffc635d5c04d380f354ee6.tar.gz |
Since the netexport struct was centralised to 'struct mount',
attempting to remove nonexistant exports with MNT_DELEXPORT returns
an error; before this change it always succeeded. This caused
mountd(8) to log "can't delete exports for /whatever" warnings.
Change the error code from EINVAL to a more specific ENOENT, and
make mountd ignore this error when deleting the export list. I
could have just restored the previous behaviour of returning success,
but I think an error return is a useful diagnostic.
Reviewed by: phk
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/mountd/mountd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 0c08f40..35ea7da 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -950,9 +950,10 @@ get_exportlist() targs.ua.fspec = NULL; targs.ua.export.ex_flags = MNT_DELEXPORT; if (mount(fsp->f_fstypename, fsp->f_mntonname, - fsp->f_flags | MNT_UPDATE, - (caddr_t)&targs) < 0) - syslog(LOG_ERR, "can't delete exports for %s", + fsp->f_flags | MNT_UPDATE, (caddr_t)&targs) < 0 && + errno != ENOENT) + syslog(LOG_ERR, + "can't delete exports for %s: %m", fsp->f_mntonname); } fsp++; |