Deal with nfs server module changes for autoloading.

This commit is contained in:
Peter Wemm 2001-09-20 02:18:06 +00:00
parent 4a0785aaff
commit 12f8604fde
2 changed files with 8 additions and 18 deletions

View File

@ -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;

View File

@ -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;