From 84dcbb7594edee2f15bdaa91d1ca7de55c6a7d58 Mon Sep 17 00:00:00 2001 From: Alex Hornung Date: Sun, 21 Nov 2010 10:03:39 +0000 Subject: [PATCH] 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 --- sbin/mount_devfs/mount_devfs.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sbin/mount_devfs/mount_devfs.c b/sbin/mount_devfs/mount_devfs.c index 59a138b..de6fd07 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) { -- 1.7.7.2