summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2015-12-01 00:48:31 +0000
committersmh <smh@FreeBSD.org>2015-12-01 00:48:31 +0000
commitacd245f48b0de0fc33de0b76b5d8c4306c16b7ab (patch)
treee866699fb65efa4944595fc30ecb5e36e0385a45 /sys/geom
parent8cd0a777b228637613566107e39ea777746899ff (diff)
downloadFreeBSD-src-acd245f48b0de0fc33de0b76b5d8c4306c16b7ab.zip
FreeBSD-src-acd245f48b0de0fc33de0b76b5d8c4306c16b7ab.tar.gz
MFC r288153:
Use kenv 'dumpdev' in the same way as etc/rc.d/dumpon Sponsored by: Multiplay
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_dev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 8ee9ed8..bd8eb74 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -124,6 +124,7 @@ g_dev_fini(struct g_class *mp)
{
freeenv(dumpdev);
+ dumpdev = NULL;
}
static int
@@ -152,10 +153,16 @@ g_dev_setdumpdev(struct cdev *dev, struct thread *td)
static void
init_dumpdev(struct cdev *dev)
{
+ const char *devprefix = "/dev/", *devname;
+ size_t len;
if (dumpdev == NULL)
return;
- if (strcmp(devtoname(dev), dumpdev) != 0)
+ len = strlen(devprefix);
+ devname = devtoname(dev);
+ if (strcmp(devname, dumpdev) != 0 &&
+ (strncmp(dumpdev, devprefix, len) != 0 ||
+ strcmp(devname, dumpdev + len) != 0))
return;
if (g_dev_setdumpdev(dev, curthread) == 0) {
freeenv(dumpdev);
OpenPOWER on IntegriCloud