From 17371dd63273e6fbfda1f5f9ed0fb9b7a8853e73 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 6 May 1999 16:08:54 +0000 Subject: [PATCH] Make this compile... --- sbin/mount_ntfs/Makefile | 5 +++-- sbin/mount_ntfs/mount_ntfs.8 | 3 ++- sbin/mount_ntfs/mount_ntfs.c | 29 +++++++++++++++++++++++------ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/sbin/mount_ntfs/Makefile b/sbin/mount_ntfs/Makefile index dde8d49771bd..95c4469714ef 100644 --- a/sbin/mount_ntfs/Makefile +++ b/sbin/mount_ntfs/Makefile @@ -1,13 +1,14 @@ +# $NetBSD: Makefile,v 1.2 1999/05/06 16:08:54 christos Exp $ # # Id: Makefile,v 1.1.1.1 1999/02/03 03:51:19 semenu Exp # PROG= mount_ntfs SRCS= mount_ntfs.c getmntopts.c -MAN8= mount_ntfs.8 +MAN= mount_ntfs.8 MOUNT= ${.CURDIR}/../mount -CFLAGS+= -I${.CURDIR}/../../sys -I${MOUNT} +CPPFLAGS+= -I${.CURDIR}/../../sys -I${MOUNT} .PATH: ${MOUNT} .include diff --git a/sbin/mount_ntfs/mount_ntfs.8 b/sbin/mount_ntfs/mount_ntfs.8 index 18d9bea5b68c..e3910f03f2ac 100644 --- a/sbin/mount_ntfs/mount_ntfs.8 +++ b/sbin/mount_ntfs/mount_ntfs.8 @@ -1,3 +1,4 @@ +.\" $NetBSD: mount_ntfs.8,v 1.2 1999/05/06 16:08:55 christos Exp $ .\" .\" Copyright (c) 1993,1994 Christopher G. Demetriou .\" Copyright (c) 1999 Semen Ustimenko @@ -32,7 +33,7 @@ .\" .Dd Jan 3, 1999 .Dt MOUNT_NTFS 8 -.Os FreeBSD +.Os .Sh NAME .Nm mount_ntfs .Nd mount an NTFS file system diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index 3e9e2122d339..850aadf4b85c 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -1,3 +1,5 @@ +/* $NetBSD: mount_ntfs.c,v 1.2 1999/05/06 16:08:55 christos Exp $ */ + /* * Copyright (c) 1994 Christopher G. Demetriou * Copyright (c) 1999 Semen Ustimenko @@ -31,6 +33,10 @@ * Id: mount_ntfs.c,v 1.1.1.1 1999/02/03 03:51:19 semenu Exp * */ +#include +#ifndef lint +__RCSID("$NetBSD: mount_ntfs.c,v 1.2 1999/05/06 16:08:55 christos Exp $"); +#endif #include #include @@ -55,11 +61,17 @@ static struct mntopt mopts[] = { { NULL } }; +#ifndef __dead2 +#define __dead2 __attribute__((__noreturn__)) +#endif + static gid_t a_gid __P((char *)); static uid_t a_uid __P((char *)); static mode_t a_mask __P((char *)); static void usage __P((void)) __dead2; +int main __P((int, char **)); + int main(argc, argv) int argc; @@ -67,12 +79,14 @@ main(argc, argv) { struct ntfs_args args; struct stat sb; - int c, mntflags, set_gid, set_uid, set_mask,error; + int c, mntflags, set_gid, set_uid, set_mask; char *dev, *dir, ndir[MAXPATHLEN+1]; +#ifdef __FreeBSD__ #if __FreeBSD_version >= 300000 struct vfsconf vfc; #else struct vfsconf *vfc; +#endif #endif mntflags = set_gid = set_uid = set_mask = 0; @@ -140,10 +154,10 @@ main(argc, argv) if (!set_mask) args.mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); } - +#ifdef __FreeBSD__ #if __FreeBSD_version >= 300000 - error = getvfsbyname("ntfs", &vfc); - if(error && vfsisloadable("ntfs")) { + c = getvfsbyname("ntfs", &vfc); + if(c && vfsisloadable("ntfs")) { if(vfsload("ntfs")) #else vfc = getvfsbyname("ntfs"); @@ -153,13 +167,13 @@ main(argc, argv) err(EX_OSERR, "vfsload(ntfs)"); endvfsent(); /* clear cache */ #if __FreeBSD_version >= 300000 - error = getvfsbyname("ntfs", &vfc); + c = getvfsbyname("ntfs", &vfc); #else vfc = getvfsbyname("ntfs"); #endif } #if __FreeBSD_version >= 300000 - if (error) + if (c) #else if (!vfc) #endif @@ -169,6 +183,9 @@ main(argc, argv) if (mount(vfc.vfc_name, dir, mntflags, &args) < 0) #else if (mount(vfc->vfc_index, dir, mntflags, &args) < 0) +#endif +#else + if (mount(MOUNT_NTFS, dir, mntflags, &args) < 0) #endif err(EX_OSERR, "%s", dev);