+ mnttype = getmnttype(fs->fs_vfstype);
+ exit(mountfs(fs->fs_spec, fs->fs_file, updateflg,
+ type, options, fs->fs_mntops));
+ }
+
+ if (argc != 2)
+ usage();
+
+ exit(mountfs(argv[0], argv[1], updateflg, type, options, NULL));
+}
+
+mountfs(spec, name, flags, type, options, mntopts)
+ char *spec, *name, *type, *options, *mntopts;
+ int flags;
+{
+ extern int errno;
+ register int cnt;
+ int argc, status, i;
+ struct ufs_args args;
+ char *argp, *argv[50];
+ char execname[MAXPATHLEN + 1], flagval[12];
+
+ if (mntopts)
+ getstdopts(mntopts, &flags);
+ if (options)
+ getstdopts(options, &flags);
+ if (type)
+ getstdopts(type, &flags);
+ switch (mnttype) {
+ case MOUNT_UFS:
+ if (mntopts)
+ getufsopts(mntopts, &flags);
+ if (options)
+ getufsopts(options, &flags);
+ args.fspec = spec;
+ argp = (caddr_t)&args;
+ break;
+
+#ifdef NFS
+ case MOUNT_NFS:
+ retrycnt = DEF_RETRY;
+ if (mntopts)
+ getnfsopts(mntopts, &nfsargs, &opflags, &retrycnt);
+ if (options)
+ getnfsopts(options, &nfsargs, &opflags, &retrycnt);
+ if (argp = getnfsargs(spec, name, type))
+ break;
+ return (1);
+#endif /* NFS */
+
+ case MOUNT_MFS:
+ default:
+ argv[0] = mntname;
+ argc = 1;
+ if (flags) {
+ argv[argc++] = "-F";
+ sprintf(flagval, "%d", flags);
+ argv[argc++] = flagval;
+ }
+ if (mntopts)
+ argc += getexecopts(mntopts, &argv[argc]);
+ if (options)
+ argc += getexecopts(options, &argv[argc]);
+ argv[argc++] = spec;
+ argv[argc++] = name;
+ argv[argc++] = NULL;
+ sprintf(execname, "%s/mount_%s", _PATH_EXECDIR, mntname);
+ if (verbose) {
+ printf("exec: %s", execname);
+ for (i = 1; i < argc; i++)
+ printf(" %s", argv[i]);
+ printf("\n");
+ }
+ if (fake)
+ break;
+ if (i = vfork()) {
+ if (i == -1) {
+ perror("mount: vfork starting file system");
+ return (1);
+ }
+ if (waitpid(i, &status, 0) != -1 &&
+ WIFEXITED(status) &&
+ WEXITSTATUS(status) != 0)
+ return (WEXITSTATUS(status));
+ spec = mntname;
+ goto out;