Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/mount_ntfs Make this compile...



details:   https://anonhg.NetBSD.org/src/rev/ef8ef8b123a6
branches:  trunk
changeset: 472762:ef8ef8b123a6
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 06 16:08:54 1999 +0000

description:
Make this compile...

diffstat:

 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(-)

diffs (132 lines):

diff -r 1214a1ef6a28 -r ef8ef8b123a6 sbin/mount_ntfs/Makefile
--- a/sbin/mount_ntfs/Makefile  Thu May 06 16:05:26 1999 +0000
+++ b/sbin/mount_ntfs/Makefile  Thu May 06 16:08:54 1999 +0000
@@ -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 <bsd.prog.mk>
diff -r 1214a1ef6a28 -r ef8ef8b123a6 sbin/mount_ntfs/mount_ntfs.8
--- a/sbin/mount_ntfs/mount_ntfs.8      Thu May 06 16:05:26 1999 +0000
+++ b/sbin/mount_ntfs/mount_ntfs.8      Thu May 06 16:08:54 1999 +0000
@@ -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 -r 1214a1ef6a28 -r ef8ef8b123a6 sbin/mount_ntfs/mount_ntfs.c
--- a/sbin/mount_ntfs/mount_ntfs.c      Thu May 06 16:05:26 1999 +0000
+++ b/sbin/mount_ntfs/mount_ntfs.c      Thu May 06 16:08:54 1999 +0000
@@ -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 <sys/cdefs.h>
+#ifndef lint
+__RCSID("$NetBSD: mount_ntfs.c,v 1.2 1999/05/06 16:08:55 christos Exp $");
+#endif
 
 #include <sys/cdefs.h>
 #include <sys/param.h>
@@ -55,11 +61,17 @@
        { 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,13 +79,15 @@
 {
        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;
        (void)memset(&args, '\0', sizeof(args));
@@ -140,10 +154,10 @@
                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 @@
                        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
@@ -170,6 +184,9 @@
 #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);
 
        exit (0);



Home | Main Index | Thread Index | Old Index