[Midnightbsd-cvs] src [8033] trunk/sys/geom/geom_subr.c: allow passing with /dev prefix

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 15 16:39:01 EDT 2016


Revision: 8033
          http://svnweb.midnightbsd.org/src/?rev=8033
Author:   laffer1
Date:     2016-09-15 16:39:01 -0400 (Thu, 15 Sep 2016)
Log Message:
-----------
allow passing with /dev prefix

Modified Paths:
--------------
    trunk/sys/geom/geom_subr.c

Modified: trunk/sys/geom/geom_subr.c
===================================================================
--- trunk/sys/geom/geom_subr.c	2016-09-15 20:34:15 UTC (rev 8032)
+++ trunk/sys/geom/geom_subr.c	2016-09-15 20:39:01 UTC (rev 8033)
@@ -601,6 +601,10 @@
 	pp->error = error;
 }
 
+#ifndef	_PATH_DEV
+#define	_PATH_DEV	"/dev/"
+#endif
+
 struct g_provider *
 g_provider_by_name(char const *arg)
 {
@@ -608,6 +612,9 @@
 	struct g_geom *gp;
 	struct g_provider *pp;
 
+	if (strncmp(arg, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
+		arg += sizeof(_PATH_DEV) - 1;
+
 	LIST_FOREACH(cp, &g_classes, class) {
 		LIST_FOREACH(gp, &cp->geom, geom) {
 			LIST_FOREACH(pp, &gp->provider, provider) {
@@ -616,6 +623,7 @@
 			}
 		}
 	}
+
 	return (NULL);
 }
 



More information about the Midnightbsd-cvs mailing list