Deleted Added
full compact
41c41
< static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94";
---
> static const char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
47a48
>
48a50
> #include <ufs/ufs/ufsmount.h>
49a52,54
>
> #include <ctype.h>
> #include <err.h>
54a60
>
56,59d61
< static int argtoi __P((int flag, char *req, char *str, int base));
< static int docheck __P((struct fstab *fsp));
< static int checkfilesys __P((char *filesys, char *mntpt, long auxdata,
< int child));
60a63,70
> int returntosingle;
>
> static int argtoi __P((int flag, char *req, char *str, int base));
> static int docheck __P((struct fstab *fsp));
> static int checkfilesys __P((char *filesys, char *mntpt, long auxdata,
> int child));
> int main __P((int argc, char *argv[]));
>
102c112
< errexit("bad mode to -m: %o\n", lfmode);
---
> errx(EEXIT, "bad mode to -m: %o", lfmode);
119c129
< errexit("%c option?\n", ch);
---
> errx(EEXIT, "%c option?", ch);
139c149
< int
---
> static int
150c160
< errexit("-%c flag requires a %s\n", flag, req);
---
> errx(EEXIT, "-%c flag requires a %s", flag, req);
157c167
< int
---
> static int
174c184
< int
---
> static int
180c190
< daddr_t n_ffree, n_bfree;
---
> ufs_daddr_t n_ffree, n_bfree;
183c193
< int cylno;
---
> int cylno, flags;
190c200,201
< if (setup(filesys) == 0) {
---
> switch (setup(filesys)) {
> case 0:
192a204,205
> /* fall through */
> case -1:
305c318,330
< ckfini();
---
> if (!hotroot) {
> ckfini(1);
> } else {
> struct statfs stfs_buf;
> /*
> * Check to see if root is mounted read-write.
> */
> if (statfs("/", &stfs_buf) == 0)
> flags = stfs_buf.f_flags;
> else
> flags = 0;
> ckfini(flags & MNT_RDONLY);
> }
316c341,342
< struct statfs stfs_buf;
---
> struct ufs_args args;
> int ret;
321,334c347,354
< if (statfs("/", &stfs_buf) == 0) {
< long flags = stfs_buf.f_flags;
< struct ufs_args args;
< int ret;
<
< if (flags & MNT_RDONLY) {
< args.fspec = 0;
< args.export.ex_flags = 0;
< args.export.ex_root = 0;
< flags |= MNT_UPDATE | MNT_RELOAD;
< ret = mount(MOUNT_UFS, "/", flags, &args);
< if (ret == 0)
< return(0);
< }
---
> if (flags & MNT_RDONLY) {
> args.fspec = 0;
> args.export.ex_flags = 0;
> args.export.ex_root = 0;
> flags |= MNT_UPDATE | MNT_RELOAD;
> ret = mount("ufs", "/", flags, &args);
> if (ret == 0)
> return (0);