diff options
Diffstat (limited to 'sbin/nfsd')
-rw-r--r-- | sbin/nfsd/nfsd.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c index eadaf8d..a00dc88 100644 --- a/sbin/nfsd/nfsd.c +++ b/sbin/nfsd/nfsd.c @@ -132,18 +132,13 @@ main(argc, argv, envp) int bindhostc = 0, bindanyflag, rpcbreg, rpcbregcnt; char **bindhost = NULL; pid_t pid; - struct vfsconf vfc; int error; - error = getvfsbyname("nfs", &vfc); - if (error && vfsisloadable("nfs")) { - if (vfsload("nfs")) - err(1, "vfsload(nfs)"); - endvfsent(); /* flush cache */ - error = getvfsbyname("nfs", &vfc); + if (modfind("nfsserver") < 0) { + /* Not present in kernel, try loading it */ + if (kldload("nfsserver") < 0 || modfind("nfsserver") < 0) + errx(1, "NFS serveris not available"); } - if (error) - errx(1, "NFS is not available in the running kernel"); nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = 0; |