diff options
author | peter <peter@FreeBSD.org> | 1997-03-11 12:40:45 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-03-11 12:40:45 +0000 |
commit | 1c0f77f024b01c2df41c395b7e5afd760d0a9062 (patch) | |
tree | 8250189179b31e1866ff4aede6002aa33af8d808 /sbin/mount_cd9660 | |
parent | f461294e0761e04bbc572e265770de9410b31c41 (diff) | |
download | FreeBSD-src-1c0f77f024b01c2df41c395b7e5afd760d0a9062.zip FreeBSD-src-1c0f77f024b01c2df41c395b7e5afd760d0a9062.tar.gz |
Merge from Lite2 (use new getvfsbyname() and mount(2) interface)
Diffstat (limited to 'sbin/mount_cd9660')
-rw-r--r-- | sbin/mount_cd9660/Makefile | 1 | ||||
-rw-r--r-- | sbin/mount_cd9660/mount_cd9660.c | 34 |
2 files changed, 17 insertions, 18 deletions
diff --git a/sbin/mount_cd9660/Makefile b/sbin/mount_cd9660/Makefile index fc192a5..61129f3 100644 --- a/sbin/mount_cd9660/Makefile +++ b/sbin/mount_cd9660/Makefile @@ -5,6 +5,7 @@ SRCS= mount_cd9660.c getmntopts.c MAN8= mount_cd9660.8 MOUNT= ${.CURDIR}/../mount +CFLAGS+= -D_NEW_VFSCONF CFLAGS+= -I${MOUNT} .PATH: ${MOUNT} diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index 463b660..9434f3c 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)mount_cd9660.c 8.4 (Berkeley) 3/27/94 + * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95 */ #ifndef lint @@ -46,15 +46,15 @@ static char copyright[] = #ifndef lint /* -static char sccsid[] = "@(#)mount_cd9660.c 8.4 (Berkeley) 3/27/94"; +static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95"; */ static const char rcsid[] = - "$Id$"; + "$Id: mount_cd9660.c,v 1.9 1997/02/22 14:32:44 peter Exp $"; #endif /* not lint */ #include <sys/param.h> -#define CD9660 #include <sys/mount.h> +#include <sys/../isofs/cd9660/cd9660_mount.h> #include <err.h> #include <stdlib.h> @@ -84,7 +84,8 @@ main(argc, argv) struct iso_args args; int ch, mntflags, opts; char *dev, *dir; - struct vfsconf *vfc; + struct vfsconf vfc; + int error; mntflags = opts = 0; while ((ch = getopt(argc, argv, "ego:r")) != EOF) @@ -115,30 +116,27 @@ main(argc, argv) dir = argv[1]; #define DEFAULT_ROOTUID -2 - args.fspec = dev; - args.export.ex_root = DEFAULT_ROOTUID; - /* * ISO 9660 filesystems are not writeable. */ mntflags |= MNT_RDONLY; args.export.ex_flags = MNT_EXRDONLY; - + args.fspec = dev; + args.export.ex_root = DEFAULT_ROOTUID; args.flags = opts; - vfc = getvfsbyname("cd9660"); - if(!vfc && vfsisloadable("cd9660")) { - if(vfsload("cd9660")) { + error = getvfsbyname("cd9660", &vfc); + if (error && vfsisloadable("cd9660")) { + if (vfsload("cd9660")) err(EX_OSERR, "vfsload(cd9660)"); - } endvfsent(); /* flush cache */ - vfc = getvfsbyname("cd9660"); + error = getvfsbyname("cd9660", &vfc); } - if (!vfc) - errx(EX_OSERR, "cd9660 filesystem not available"); + if (error) + errx(1, "cd9660 filesystem is not available"); - if (mount(vfc->vfc_index, dir, mntflags, &args) < 0) - err(EX_OSERR, "%s", dev); + if (mount(vfc.vfc_name, dir, mntflags, &args) < 0) + err(1, NULL); exit(0); } |