Date: Tue, 1 Dec 2015 00:48:31 +0000 (UTC) From: Steven Hartland <smh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291547 - stable/10/sys/geom Message-ID: <201512010048.tB10mV5c028235@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: smh Date: Tue Dec 1 00:48:31 2015 New Revision: 291547 URL: https://svnweb.freebsd.org/changeset/base/291547 Log: MFC r288153: Use kenv 'dumpdev' in the same way as etc/rc.d/dumpon Sponsored by: Multiplay Modified: stable/10/sys/geom/geom_dev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_dev.c ============================================================================== --- stable/10/sys/geom/geom_dev.c Tue Dec 1 00:32:09 2015 (r291546) +++ stable/10/sys/geom/geom_dev.c Tue Dec 1 00:48:31 2015 (r291547) @@ -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, struc 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512010048.tB10mV5c028235>