Updated mount_msdos to use the Lite2 getvfsbyname() interface.
This commit is contained in:
parent
cdd42308ce
commit
8f86703906
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23335
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
# $Id: Makefile,v 1.4 1997/02/22 14:32:29 peter Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
PROG= mount_msdos
|
PROG= mount_msdos
|
||||||
@ -10,6 +10,7 @@ BINOWN= root
|
|||||||
BINMODE= 4555
|
BINMODE= 4555
|
||||||
|
|
||||||
MOUNT= ${.CURDIR}/../../mount
|
MOUNT= ${.CURDIR}/../../mount
|
||||||
|
CFLAGS+= -D_NEW_VFSCONF
|
||||||
CFLAGS+= -I${MOUNT}
|
CFLAGS+= -I${MOUNT}
|
||||||
.PATH: ${MOUNT}
|
.PATH: ${MOUNT}
|
||||||
|
|
||||||
|
@ -30,14 +30,15 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: mount_msdos.c,v 1.7 1997/02/22 14:32:30 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#define MSDOSFS
|
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <msdosfs/msdosfsmount.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
@ -67,9 +68,9 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
struct msdosfs_args args;
|
struct msdosfs_args args;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int c, mntflags, set_gid, set_uid, set_mask;
|
int c, error, mntflags, set_gid, set_uid, set_mask;
|
||||||
char *dev, *dir, ndir[MAXPATHLEN+1];
|
char *dev, *dir, ndir[MAXPATHLEN+1];
|
||||||
struct vfsconf *vfc;
|
struct vfsconf vfc;
|
||||||
|
|
||||||
mntflags = set_gid = set_uid = set_mask = 0;
|
mntflags = set_gid = set_uid = set_mask = 0;
|
||||||
(void)memset(&args, '\0', sizeof(args));
|
(void)memset(&args, '\0', sizeof(args));
|
||||||
@ -131,17 +132,17 @@ main(argc, argv)
|
|||||||
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfc = getvfsbyname("msdos");
|
error = getvfsbyname("msdos", &vfc);
|
||||||
if(!vfc && vfsisloadable("msdos")) {
|
if (error && vfsisloadable("msdos")) {
|
||||||
if(vfsload("msdos"))
|
if (vfsload("msdos"))
|
||||||
err(EX_OSERR, "vfsload(msdos)");
|
err(EX_OSERR, "vfsload(msdos)");
|
||||||
endvfsent(); /* clear cache */
|
endvfsent(); /* clear cache */
|
||||||
vfc = getvfsbyname("msdos");
|
error = getvfsbyname("msdos", &vfc);
|
||||||
}
|
}
|
||||||
if (!vfc)
|
if (error)
|
||||||
errx(EX_OSERR, "msdos filesystem is not available");
|
errx(EX_OSERR, "msdos filesystem is not available");
|
||||||
|
|
||||||
if (mount(vfc->vfc_index, dir, mntflags, &args) < 0)
|
if (mount(vfc.vfc_name, dir, mntflags, &args) < 0)
|
||||||
err(EX_OSERR, "%s", dev);
|
err(EX_OSERR, "%s", dev);
|
||||||
|
|
||||||
exit (0);
|
exit (0);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
# $Id: Makefile,v 1.4 1997/02/22 14:32:29 peter Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
PROG= mount_msdos
|
PROG= mount_msdos
|
||||||
@ -10,6 +10,7 @@ BINOWN= root
|
|||||||
BINMODE= 4555
|
BINMODE= 4555
|
||||||
|
|
||||||
MOUNT= ${.CURDIR}/../../mount
|
MOUNT= ${.CURDIR}/../../mount
|
||||||
|
CFLAGS+= -D_NEW_VFSCONF
|
||||||
CFLAGS+= -I${MOUNT}
|
CFLAGS+= -I${MOUNT}
|
||||||
.PATH: ${MOUNT}
|
.PATH: ${MOUNT}
|
||||||
|
|
||||||
|
@ -30,14 +30,15 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: mount_msdos.c,v 1.7 1997/02/22 14:32:30 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#define MSDOSFS
|
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <msdosfs/msdosfsmount.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
@ -67,9 +68,9 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
struct msdosfs_args args;
|
struct msdosfs_args args;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int c, mntflags, set_gid, set_uid, set_mask;
|
int c, error, mntflags, set_gid, set_uid, set_mask;
|
||||||
char *dev, *dir, ndir[MAXPATHLEN+1];
|
char *dev, *dir, ndir[MAXPATHLEN+1];
|
||||||
struct vfsconf *vfc;
|
struct vfsconf vfc;
|
||||||
|
|
||||||
mntflags = set_gid = set_uid = set_mask = 0;
|
mntflags = set_gid = set_uid = set_mask = 0;
|
||||||
(void)memset(&args, '\0', sizeof(args));
|
(void)memset(&args, '\0', sizeof(args));
|
||||||
@ -131,17 +132,17 @@ main(argc, argv)
|
|||||||
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfc = getvfsbyname("msdos");
|
error = getvfsbyname("msdos", &vfc);
|
||||||
if(!vfc && vfsisloadable("msdos")) {
|
if (error && vfsisloadable("msdos")) {
|
||||||
if(vfsload("msdos"))
|
if (vfsload("msdos"))
|
||||||
err(EX_OSERR, "vfsload(msdos)");
|
err(EX_OSERR, "vfsload(msdos)");
|
||||||
endvfsent(); /* clear cache */
|
endvfsent(); /* clear cache */
|
||||||
vfc = getvfsbyname("msdos");
|
error = getvfsbyname("msdos", &vfc);
|
||||||
}
|
}
|
||||||
if (!vfc)
|
if (error)
|
||||||
errx(EX_OSERR, "msdos filesystem is not available");
|
errx(EX_OSERR, "msdos filesystem is not available");
|
||||||
|
|
||||||
if (mount(vfc->vfc_index, dir, mntflags, &args) < 0)
|
if (mount(vfc.vfc_name, dir, mntflags, &args) < 0)
|
||||||
err(EX_OSERR, "%s", dev);
|
err(EX_OSERR, "%s", dev);
|
||||||
|
|
||||||
exit (0);
|
exit (0);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
# $Id: Makefile,v 1.4 1997/02/22 14:32:29 peter Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
PROG= mount_msdos
|
PROG= mount_msdos
|
||||||
@ -10,6 +10,7 @@ BINOWN= root
|
|||||||
BINMODE= 4555
|
BINMODE= 4555
|
||||||
|
|
||||||
MOUNT= ${.CURDIR}/../../mount
|
MOUNT= ${.CURDIR}/../../mount
|
||||||
|
CFLAGS+= -D_NEW_VFSCONF
|
||||||
CFLAGS+= -I${MOUNT}
|
CFLAGS+= -I${MOUNT}
|
||||||
.PATH: ${MOUNT}
|
.PATH: ${MOUNT}
|
||||||
|
|
||||||
|
@ -30,14 +30,15 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: mount_msdos.c,v 1.7 1997/02/22 14:32:30 peter Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#define MSDOSFS
|
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <msdosfs/msdosfsmount.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
@ -67,9 +68,9 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
struct msdosfs_args args;
|
struct msdosfs_args args;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int c, mntflags, set_gid, set_uid, set_mask;
|
int c, error, mntflags, set_gid, set_uid, set_mask;
|
||||||
char *dev, *dir, ndir[MAXPATHLEN+1];
|
char *dev, *dir, ndir[MAXPATHLEN+1];
|
||||||
struct vfsconf *vfc;
|
struct vfsconf vfc;
|
||||||
|
|
||||||
mntflags = set_gid = set_uid = set_mask = 0;
|
mntflags = set_gid = set_uid = set_mask = 0;
|
||||||
(void)memset(&args, '\0', sizeof(args));
|
(void)memset(&args, '\0', sizeof(args));
|
||||||
@ -131,17 +132,17 @@ main(argc, argv)
|
|||||||
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfc = getvfsbyname("msdos");
|
error = getvfsbyname("msdos", &vfc);
|
||||||
if(!vfc && vfsisloadable("msdos")) {
|
if (error && vfsisloadable("msdos")) {
|
||||||
if(vfsload("msdos"))
|
if (vfsload("msdos"))
|
||||||
err(EX_OSERR, "vfsload(msdos)");
|
err(EX_OSERR, "vfsload(msdos)");
|
||||||
endvfsent(); /* clear cache */
|
endvfsent(); /* clear cache */
|
||||||
vfc = getvfsbyname("msdos");
|
error = getvfsbyname("msdos", &vfc);
|
||||||
}
|
}
|
||||||
if (!vfc)
|
if (error)
|
||||||
errx(EX_OSERR, "msdos filesystem is not available");
|
errx(EX_OSERR, "msdos filesystem is not available");
|
||||||
|
|
||||||
if (mount(vfc->vfc_index, dir, mntflags, &args) < 0)
|
if (mount(vfc.vfc_name, dir, mntflags, &args) < 0)
|
||||||
err(EX_OSERR, "%s", dev);
|
err(EX_OSERR, "%s", dev);
|
||||||
|
|
||||||
exit (0);
|
exit (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user