mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-02 12:20:51 +00:00
Don't fail when the vfs.nfs.nfs_privport sysctl doesn't exist
(presumably because the kernel is old). Moved the declaration of a variable realated to this sysctl outside of an unrelated ifdef. Not fixed: - this sysctl is badly named (nfs occurs twice). - it's silly to have for FreeBSD in FreeBSD code, especially when only half of the FreeBSD-dependent code is ifdefed.
This commit is contained in:
parent
67fd3b9895
commit
1f45d4d4eb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24489
@ -43,7 +43,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */
|
||||
static const char rcsid[] =
|
||||
"$Id: mountd.c,v 1.15 1997/03/27 20:00:48 guido Exp $";
|
||||
"$Id: mountd.c,v 1.16 1997/03/29 03:32:49 imp Exp $";
|
||||
#endif /*not lint*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -254,10 +254,10 @@ main(argc, argv)
|
||||
{
|
||||
SVCXPRT *udptransp, *tcptransp;
|
||||
int c;
|
||||
int mib[3];
|
||||
#ifdef __FreeBSD__
|
||||
struct vfsconf vfc;
|
||||
int error;
|
||||
int mib[3];
|
||||
|
||||
error = getvfsbyname("nfs", &vfc);
|
||||
if (error && vfsisloadable("nfs")) {
|
||||
@ -321,8 +321,8 @@ main(argc, argv)
|
||||
mib[0] = CTL_VFS;
|
||||
mib[1] = MOUNT_NFS;
|
||||
mib[2] = NFS_NFSPRIVPORT;
|
||||
if (sysctl(mib, 3, NULL, NULL,
|
||||
&resvport_only, sizeof(resvport_only)) != 0) {
|
||||
if (sysctl(mib, 3, NULL, NULL, &resvport_only,
|
||||
sizeof(resvport_only)) != 0 && errno != ENOENT) {
|
||||
syslog(LOG_ERR, "sysctl: %m");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */
|
||||
static const char rcsid[] =
|
||||
"$Id: mountd.c,v 1.15 1997/03/27 20:00:48 guido Exp $";
|
||||
"$Id: mountd.c,v 1.16 1997/03/29 03:32:49 imp Exp $";
|
||||
#endif /*not lint*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -254,10 +254,10 @@ main(argc, argv)
|
||||
{
|
||||
SVCXPRT *udptransp, *tcptransp;
|
||||
int c;
|
||||
int mib[3];
|
||||
#ifdef __FreeBSD__
|
||||
struct vfsconf vfc;
|
||||
int error;
|
||||
int mib[3];
|
||||
|
||||
error = getvfsbyname("nfs", &vfc);
|
||||
if (error && vfsisloadable("nfs")) {
|
||||
@ -321,8 +321,8 @@ main(argc, argv)
|
||||
mib[0] = CTL_VFS;
|
||||
mib[1] = MOUNT_NFS;
|
||||
mib[2] = NFS_NFSPRIVPORT;
|
||||
if (sysctl(mib, 3, NULL, NULL,
|
||||
&resvport_only, sizeof(resvport_only)) != 0) {
|
||||
if (sysctl(mib, 3, NULL, NULL, &resvport_only,
|
||||
sizeof(resvport_only)) != 0 && errno != ENOENT) {
|
||||
syslog(LOG_ERR, "sysctl: %m");
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user