$NetBSD: patch-ad,v 1.5 2004/11/19 12:35:22 sketch Exp $ --- src/NFSFileSystem.c++.orig 2003-01-18 14:18:12.000000000 +0000 +++ src/NFSFileSystem.c++ 2004-11-08 17:31:41.663685000 +0000 @@ -24,7 +24,7 @@ #include "NFSFileSystem.h" #include -#include +#include "fam-mntent.h" #include #include #include @@ -41,12 +41,20 @@ #define ACREGMIN 3 #endif +#if defined(HAVE_SYS_MNTTAB_H) +NFSFileSystem::NFSFileSystem(const mnttab& mnt) +#else NFSFileSystem::NFSFileSystem(const mntent& mnt) +#endif : FileSystem(mnt) { // Extract the host name from the fs name. +#if defined(HAVE_SYS_MNTTAB_H) + const char *fsname = mnt.mnt_special; +#else const char *fsname = mnt.mnt_fsname; +#endif const char *colon = strchr(fsname, ':'); if(colon == NULL) { @@ -55,12 +63,12 @@ assert(colon); colon = fsname; } - char hostname[NAME_MAX + 1]; + char hostname[MAXPATHLEN + 1]; int hostnamelen = colon - fsname; - if(hostnamelen > NAME_MAX) + if(hostnamelen > MAXPATHLEN) { - assert(hostnamelen <= NAME_MAX); - hostnamelen = NAME_MAX; + assert(hostnamelen <= MAXPATHLEN); + hostnamelen = MAXPATHLEN; } strncpy(hostname, fsname, hostnamelen); hostname[hostnamelen] = '\0'; @@ -84,7 +92,11 @@ // acregmin, acregmax, actimeo, and noac options in the mount // options. Otherwise, use defaults. +#if defined(HAVE_SYS_MNTTAB_H) + const char * opt = mnt.mnt_mntopts; +#else const char * opt = mnt.mnt_opts; +#endif bool f_noac = false; bool f_actimeo = false; @@ -102,20 +114,20 @@ if (strstr(opt, "noac")) { f_noac = true; } - if ((p = strstr(opt, "actimeo"))) + if ((p = strstr((char *)opt, "actimeo"))) { if (sscanf(p, "actimeo=%i", &actimeo) == 1) { f_actimeo = true; } } - if ((p = strstr(opt, "acregmin"))) { + if ((p = strstr((char *)opt, "acregmin"))) { if (sscanf(p, "acregmin=%i", &acregmin) == 1) { f_acregmin = true; } } - if ((p = strstr(opt, "acregmax"))) { + if ((p = strstr((char *)opt, "acregmax"))) { if (sscanf(p, "acregmax=%i", &acregmax) == 1) { f_acregmax = true; }