diff options
| author | Jaakko Heinonen <jh@FreeBSD.org> | 2010-10-17 14:48:53 +0000 |
|---|---|---|
| committer | Jaakko Heinonen <jh@FreeBSD.org> | 2010-10-17 14:48:53 +0000 |
| commit | 058a466b563e2495a32637b8ace489e9cd7d3e77 (patch) | |
| tree | 2d9b5110e48e097663bf49e5c0df3b13197c7aaa /sbin | |
| parent | 8961a238905f4ae947b571d783651c71c84021b3 (diff) | |
Notes
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/mount/mount.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index b39a7d119e30..d0d0faa19f47 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -850,10 +850,18 @@ void putfsent(struct statfs *ent) { struct fstab *fst; - char *opts; + char *opts, *rw; int l; + opts = NULL; + /* flags2opts() doesn't return the "rw" option. */ + if ((ent->f_flags & MNT_RDONLY) != 0) + rw = NULL; + else + rw = catopt(NULL, "rw"); + opts = flags2opts(ent->f_flags); + opts = catopt(rw, opts); if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 || strncmp(ent->f_mntfromname, "<above>", 7) == 0) { @@ -861,10 +869,6 @@ putfsent(struct statfs *ent) +1)); } - /* - * "rw" is not a real mount option; this is why we print NULL as "rw" - * if opts is still NULL here. - */ l = strlen(ent->f_mntfromname); printf("%s%s%s%s", ent->f_mntfromname, l < 8 ? "\t" : "", @@ -876,13 +880,9 @@ putfsent(struct statfs *ent) l < 16 ? "\t" : "", l < 24 ? "\t" : " "); printf("%s\t", ent->f_fstypename); - if (opts == NULL) { - printf("%s\t", "rw"); - } else { - l = strlen(opts); - printf("%s%s", opts, - l < 8 ? "\t" : " "); - } + l = strlen(opts); + printf("%s%s", opts, + l < 8 ? "\t" : " "); free(opts); if ((fst = getfsspec(ent->f_mntfromname))) |
