summaryrefslogtreecommitdiffstats
path: root/sbin/mount_ext2fs/mount_ext2fs.c
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_ext2fs/mount_ext2fs.c
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_ext2fs/mount_ext2fs.c')
-rw-r--r--sbin/mount_ext2fs/mount_ext2fs.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sbin/mount_ext2fs/mount_ext2fs.c b/sbin/mount_ext2fs/mount_ext2fs.c
index 46bfbda..8f3be49 100644
--- a/sbin/mount_ext2fs/mount_ext2fs.c
+++ b/sbin/mount_ext2fs/mount_ext2fs.c
@@ -42,7 +42,7 @@ static char copyright[] =
static char sccsid[] = "@(#)mount_lfs.c 8.3 (Berkeley) 3/27/94";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: mount_ext2fs.c,v 1.6 1997/02/22 14:32:45 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -55,6 +55,8 @@ static const char rcsid[] =
#include <sysexits.h>
#include <unistd.h>
+#include <ufs/ufs/ufsmount.h>
+
#include "mntopts.h"
struct mntopt mopts[] = {
@@ -73,7 +75,8 @@ main(argc, argv)
struct ufs_args args;
int ch, mntflags;
char *fs_name, *options;
- struct vfsconf *vfc;
+ struct vfsconf vfc;
+ int error;
options = NULL;
mntflags = 0;
@@ -102,18 +105,18 @@ main(argc, argv)
else
args.export.ex_flags = 0;
- vfc = getvfsbyname("ext2fs");
- if(!vfc && vfsisloadable("ext2fs")) {
- if(vfsload("ext2fs")) {
+ error = getvfsbyname("ext2fs", &vfc);
+ if (error && vfsisloadable("ext2fs")) {
+ if (vfsload("ext2fs")) {
err(EX_OSERR, "vfsload(ext2fs)");
}
endvfsent(); /* flush cache */
- vfc = getvfsbyname("ext2fs");
+ error = getvfsbyname("ext2fs", &vfc);
}
- if (!vfc)
- errx(EX_OSERR, "ext2fs filesystem not available");
+ if (error)
+ errx(EX_OSERR, "ext2fs filesystem is not available");
- if (mount(vfc->vfc_index, fs_name, mntflags, &args) < 0)
+ if (mount(vfc.vfc_name, fs_name, mntflags, &args) < 0)
err(EX_OSERR, "%s", args.fspec);
exit(0);
}
OpenPOWER on IntegriCloud