aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Klausner <thomasklausner@users.sourceforge.net>2004-09-08 17:10:16 +0000
committerThomas Klausner <thomasklausner@users.sourceforge.net>2004-09-08 17:10:16 +0000
commit9c0478cbd523e84e9258f7611bcec8e099e32c1f (patch)
treed2f26a90e4e45f5c4a81933c31dc5290510e8496
parent81e8a224a763b9bf5cc5c4e5be9df3766d522784 (diff)
downloadplptools-9c0478cbd523e84e9258f7611bcec8e099e32c1f.tar.gz
plptools-9c0478cbd523e84e9258f7611bcec8e099e32c1f.tar.bz2
plptools-9c0478cbd523e84e9258f7611bcec8e099e32c1f.zip
Another NetBSD compatibility fix from the pkgsrc patch-ab by skrll.
-rw-r--r--plpnfsd/mp_mount.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/plpnfsd/mp_mount.c b/plpnfsd/mp_mount.c
index 39c3493..a654f95 100644
--- a/plpnfsd/mp_mount.c
+++ b/plpnfsd/mp_mount.c
@@ -21,7 +21,7 @@ extern int inet_addr(char *);
#define PORTMAP /* I need svcudp_create in rpc/svc_soc.h, sol 2.4 */
#endif
-#include <OSdefs.h>
+#include "OSdefs.h"
#include <stdio.h>
#include <signal.h>
#include <sys/stat.h>
@@ -63,6 +63,17 @@ static char nfshost[128];
#endif
#endif /* __FreeBSD__ */
+#ifdef __NetBSD__
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <strings.h>
+#include <nfs/nfsmount.h>
+#endif /* __NetBSD__ */
+
#include <rpc/rpc.h>
#include "nfs_prot.h"
@@ -156,7 +167,7 @@ static void doexit() {
struct mntent *ent;
#endif
#endif
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
struct stat statb;
#endif
@@ -277,7 +288,7 @@ mount_and_run(char *dir, void (*proc)(), nfs_fh *root_fh)
#else
struct nfs_args nfs_args;
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
int mount_flags;
#endif
@@ -453,20 +464,23 @@ mount_and_run(char *dir, void (*proc)(), nfs_fh *root_fh)
#endif
#ifdef __NetBSD__
+ nfs_args.version = NFS_ARGSVERSION;
nfs_args.addrlen = sizeof(sain);
nfs_args.sotype = SOCK_DGRAM;
nfs_args.maxgrouplist = NGROUPS;
nfs_args.readahead = 1;
nfs_args.addr = (struct sockaddr *) &sain;
nfs_args.fh = (void *) root_fh;
+ nfs_args.fhsize = sizeof(*root_fh);
nfs_args.wsize = PBUFSIZE;
nfs_args.rsize = PBUFSIZE;
nfs_args.retrans = 10;
nfs_args.timeo = 600;
nfs_args.hostname = PSIONHOSTNAME;
nfs_args.flags = NFSMNT_INT | NFSMNT_RETRANS | NFSMNT_TIMEO
- | NFSMNT_NOCONN | NFSMNT_DUMBTIMR | NFSMNT_MYWRITE
+ | NFSMNT_NOCONN | NFSMNT_DUMBTIMR
| NFSMNT_WSIZE | NFSMNT_RSIZE;
+ mount_flags = MNT_NOSUID | MNT_NODEV | MNT_NOEXEC | MNT_NOATIME;
#endif
#if defined(_IBMR2)
@@ -496,7 +510,7 @@ mount_and_run(char *dir, void (*proc)(), nfs_fh *root_fh)
#if defined(__sgi) || (defined(sun) && defined(__SVR4))
if (mount("", dir, MS_DATA, "nfs", &nfs_args, sizeof(nfs_args)))
#endif
-#if defined(__NetBSD__) || defined(__NeXT__)
+#if defined(__NeXT__)
if (mount(MOUNT_NFS, dir, 0, (caddr_t) & nfs_args))
#endif
#ifdef hpux
@@ -512,7 +526,7 @@ mount_and_run(char *dir, void (*proc)(), nfs_fh *root_fh)
if (aix3_mount("psion:loc", dir, 0, MOUNT_TYPE_NFS, &nfs_args, "plpnfsd"))
#endif
-#ifdef __FreeBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
#if __FreeBSD_version >= 300001
if (mount("nfs", dir, mount_flags, &nfs_args))
#else