From 3ae7ea683425f565f95b604a0558e703ab670854 Mon Sep 17 00:00:00 2001 From: Giorgos Keramidas Date: Fri, 3 Mar 2006 02:46:15 +0000 Subject: [PATCH] When there are no mount options, an implicit "rw" should be printed in the output of ``mount -p''. Approved by: rodrigc --- sbin/mount/mount.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 655ef48cc118..eb0814ef1f60 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -754,8 +754,13 @@ putfsent(ent) char *opts; opts = flags2opts(ent->f_flags); + + /* + * "rw" is not a real mount option; this is why we print NULL as "rw" + * if opts is still NULL here. + */ printf("%s\t%s\t%s %s", ent->f_mntfromname, ent->f_mntonname, - ent->f_fstypename, opts); + ent->f_fstypename, opts ? opts : "rw"); free(opts); if ((fst = getfsspec(ent->f_mntfromname)))