Module Name:    src
Committed By:   pooka
Date:           Thu Jan 13 11:57:02 UTC 2011

Modified Files:
        src/sbin/mount: mount.c

Log Message:
In case we are union-mounting /, don't force MNT_UPDATE.  This makes
the following work:

        mount -t tmpfs -o union tmpfs /

(some caveats are implied, such as if you "mkdir /usr" you're
screwed, but then again you'll get there with "rm -rf /usr" even
without union -- we supply rope)

per discussion with zafer, use case for jibbed


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sbin/mount/mount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/mount/mount.c
diff -u src/sbin/mount/mount.c:1.91 src/sbin/mount/mount.c:1.92
--- src/sbin/mount/mount.c:1.91	Thu Jan 14 21:46:24 2010
+++ src/sbin/mount/mount.c	Thu Jan 13 11:57:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $	*/
+/*	$NetBSD: mount.c,v 1.92 2011/01/13 11:57:02 pooka Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)mount.c	8.25 (Berkeley) 5/8/95";
 #else
-__RCSID("$NetBSD: mount.c,v 1.91 2010/01/14 21:46:24 pooka Exp $");
+__RCSID("$NetBSD: mount.c,v 1.92 2011/01/13 11:57:02 pooka Exp $");
 #endif
 #endif /* not lint */
 
@@ -392,7 +392,7 @@
 	if (!mntopts && !options)
 		catopt(&optbuf, "rw");
 
-	if (getargs == 0 && strcmp(name, "/") == 0)
+	if (getargs == 0 && strcmp(name, "/") == 0 && !hasopt(optbuf, "union"))
 		flags |= MNT_UPDATE;
 	else if (skipmounted) {
 		if ((numfs = getmntinfo(&sfp, MNT_WAIT)) == 0) {

Reply via email to