From: Alex Hornung Date: Sun, 21 Nov 2010 10:03:39 +0000 (+0000) Subject: mount_devfs - don't unconditionally clear rules X-Git-Tag: v2.11.0~572 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/84dcbb7594edee2f15bdaa91d1ca7de55c6a7d58 mount_devfs - don't unconditionally clear rules * mount_devfs was unconditionally clearing all rules of a mountpoint after mounting. * According to the man page (and my original intentions, I'd presume), mount_devfs should only clear the rules of a mountpoint if it was already mounted. So fix mount_devfs accordingly. Dragonfly-bug: http://bugs.dragonflybsd.org/issue1885 --- diff --git a/sbin/mount_devfs/mount_devfs.c b/sbin/mount_devfs/mount_devfs.c index 59a138b4e8..de6fd07cd2 100644 --- a/sbin/mount_devfs/mount_devfs.c +++ b/sbin/mount_devfs/mount_devfs.c @@ -145,14 +145,14 @@ main(int argc, char **argv) if (!mounted) { if (mount(vfc.vfc_name, mntpoint, mntflags, &info)) err(1, NULL); - } - - if (fork() == 0) { - execlp("devfsctl", "devfsctl", - "-m", mntpoint, - "-c", - "-r", - NULL); + } else { + if (fork() == 0) { + execlp("devfsctl", "devfsctl", + "-m", mntpoint, + "-c", + "-r", + NULL); + } } if (info.flags & DEVFS_MNT_RULESET) {