summaryrefslogtreecommitdiffstats
path: root/sbin/mount_umapfs
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_umapfs
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_umapfs')
-rw-r--r--sbin/mount_umapfs/Makefile1
-rw-r--r--sbin/mount_umapfs/mount_umapfs.84
-rw-r--r--sbin/mount_umapfs/mount_umapfs.c22
3 files changed, 14 insertions, 13 deletions
diff --git a/sbin/mount_umapfs/Makefile b/sbin/mount_umapfs/Makefile
index 780b52c..fce19db 100644
--- a/sbin/mount_umapfs/Makefile
+++ b/sbin/mount_umapfs/Makefile
@@ -5,6 +5,7 @@ SRCS= mount_umap.c getmntopts.c
MAN8= mount_umap.8
MOUNT= ${.CURDIR}/../mount
+CFLAGS+= -D_NEW_VFSCONF
CFLAGS+= -I${.CURDIR}/../../sys -I${MOUNT}
.PATH: ${MOUNT}
diff --git a/sbin/mount_umapfs/mount_umapfs.8 b/sbin/mount_umapfs/mount_umapfs.8
index b6cced9..d0ecb29 100644
--- a/sbin/mount_umapfs/mount_umapfs.8
+++ b/sbin/mount_umapfs/mount_umapfs.8
@@ -33,9 +33,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)mount_umap.8 8.3 (Berkeley) 3/27/94
+.\" @(#)mount_umap.8 8.4 (Berkeley) 5/1/95
.\"
-.Dd "March 27, 1994"
+.Dd "May 1, 1995"
.Dt MOUNT_UMAP 8
.Os BSD 4.4
.Sh NAME
diff --git a/sbin/mount_umapfs/mount_umapfs.c b/sbin/mount_umapfs/mount_umapfs.c
index 5d884ff..9872395 100644
--- a/sbin/mount_umapfs/mount_umapfs.c
+++ b/sbin/mount_umapfs/mount_umapfs.c
@@ -42,10 +42,10 @@ char copyright[] =
#ifndef lint
/*
-static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94";
+static char sccsid[] = "@(#)mount_umap.c 8.5 (Berkeley) 4/26/95";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: mount_umap.c,v 1.9 1997/02/22 14:33:00 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -100,7 +100,8 @@ main(argc, argv)
u_long gmapdata[GMAPFILEENTRIES][2], mapdata[MAPFILEENTRIES][2];
int ch, count, gnentries, mntflags, nentries;
char *gmapfile, *mapfile, *source, *target, buf[20];
- struct vfsconf *vfc;
+ struct vfsconf vfc;
+ int error;
mntflags = 0;
mapfile = gmapfile = NULL;
@@ -224,18 +225,17 @@ main(argc, argv)
args.gnentries = gnentries;
args.gmapdata = gmapdata;
- vfc = getvfsbyname("umap");
- if(!vfc && vfsisloadable("umap")) {
+ error = getvfsbyname("umap", &vfc);
+ if (error && vfsisloadable("umap")) {
if(vfsload("umap"))
err(1, "vfsload(umap)");
- endvfsent(); /* flush cache */
- vfc = getvfsbyname("umap");
- }
- if (!vfc) {
- errx(1, "umap filesystem not available");
+ endvfsent();
+ error = getvfsbyname("umap", &vfc);
}
+ if (error)
+ errx(1, "umap filesystem is not available");
- if (mount(vfc->vfc_index, argv[1], mntflags, &args))
+ if (mount(vfc.vfc_name, argv[1], mntflags, &args))
err(1, NULL);
exit(0);
}
OpenPOWER on IntegriCloud