summaryrefslogtreecommitdiffstats
path: root/sbin/mount_lfs
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-03-11 12:40:45 +0000
committerpeter <peter@FreeBSD.org>1997-03-11 12:40:45 +0000
commit1c0f77f024b01c2df41c395b7e5afd760d0a9062 (patch)
tree8250189179b31e1866ff4aede6002aa33af8d808 /sbin/mount_lfs
parentf461294e0761e04bbc572e265770de9410b31c41 (diff)
downloadFreeBSD-src-1c0f77f024b01c2df41c395b7e5afd760d0a9062.zip
FreeBSD-src-1c0f77f024b01c2df41c395b7e5afd760d0a9062.tar.gz
Merge from Lite2 (use new getvfsbyname() and mount(2) interface)
Diffstat (limited to 'sbin/mount_lfs')
-rw-r--r--sbin/mount_lfs/Makefile1
-rw-r--r--sbin/mount_lfs/mount_lfs.c22
2 files changed, 13 insertions, 10 deletions
diff --git a/sbin/mount_lfs/Makefile b/sbin/mount_lfs/Makefile
index 0020b8b..bcd1f51 100644
--- a/sbin/mount_lfs/Makefile
+++ b/sbin/mount_lfs/Makefile
@@ -5,6 +5,7 @@ SRCS= mount_lfs.c getmntopts.c
MAN8= mount_lfs.8
MOUNT= ${.CURDIR}/../mount
+CFLAGS+= -D_NEW_VFSCONF
CFLAGS+= -I${MOUNT}
.PATH: ${MOUNT}
diff --git a/sbin/mount_lfs/mount_lfs.c b/sbin/mount_lfs/mount_lfs.c
index c252b0f..0ea35df 100644
--- a/sbin/mount_lfs/mount_lfs.c
+++ b/sbin/mount_lfs/mount_lfs.c
@@ -39,14 +39,15 @@ static char copyright[] =
#ifndef lint
/*
-static char sccsid[] = "@(#)mount_lfs.c 8.3 (Berkeley) 3/27/94";
+static char sccsid[] = "@(#)mount_lfs.c 8.4 (Berkeley) 4/26/95";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: mount_lfs.c,v 1.7 1997/02/22 14:32:46 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
#include <sys/mount.h>
+#include <ufs/ufs/ufsmount.h>
#include <err.h>
#include <stdio.h>
@@ -75,7 +76,8 @@ main(argc, argv)
struct ufs_args args;
int ch, mntflags, noclean;
char *fs_name, *options;
- struct vfsconf *vfc;
+ struct vfsconf vfc;
+ int error;
int short_rds, cleaner_debug;
@@ -115,18 +117,18 @@ main(argc, argv)
else
args.export.ex_flags = 0;
- vfc = getvfsbyname("lfs");
- if(!vfc && vfsisloadable("lfs")) {
+ error = getvfsbyname("lfs", &vfc);
+ if (error && vfsisloadable("lfs")) {
if(vfsload("lfs"))
err(EX_OSERR, "vfsload(lfs)");
- endvfsent(); /* flush cache */
- vfc = getvfsbyname("lfs");
+ endvfsent(); /* clear cache */
+ error = getvfsbyname("lfs", &vfc);
}
- if (!vfc)
+ if (error)
errx(EX_OSERR, "lfs filesystem is not available");
- if (mount(vfc ? vfc->vfc_index : MOUNT_LFS, fs_name, mntflags, &args))
- err(EX_OSERR, args.fspec);
+ if (mount(vfc.vfc_name, fs_name, mntflags, &args))
+ err(1, NULL);
if (!noclean)
invoke_cleaner(fs_name, short_rds, cleaner_debug);
OpenPOWER on IntegriCloud