aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/nfsd/nfsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nfsd/nfsd.c')
-rw-r--r--usr.sbin/nfsd/nfsd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c
index 8e2d14cfa750..9d4d2263d911 100644
--- a/usr.sbin/nfsd/nfsd.c
+++ b/usr.sbin/nfsd/nfsd.c
@@ -144,6 +144,18 @@ main(argc, argv, envp)
int nfsdcnt, nfssvc_flag, on, reregister, sock, tcpflag, tcpsock;
int tp4cnt, tp4flag, tp4sock, tpipcnt, tpipflag, tpipsock, udpflag;
char *cp, **cpp;
+ struct vfsconf *vfc;
+
+ vfc = getvfsbyname("nfs");
+ if(!vfc && vfsisloadable("nfs")) {
+ if(vfsload("nfs"))
+ err(1, "vfsload(nfs)");
+ endvfsent(); /* flush cache */
+ vfc = getvfsbyname("nfs"); /* probably unnecessary */
+ }
+ if(!vfc) {
+ errx(1, "NFS is not available in the running kernel");
+ }
/* Save start and extent of argv for setproctitle. */
Argv = argv;