From: Stathis Kamperis Date: Mon, 30 Mar 2009 07:48:36 +0000 (+0000) Subject: vnconfig -l: print an error if supplied vn is unknown X-Git-Tag: v2.3.1~175^2~4 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/906f76fefd8f2e807f8f8e18da9b887206b4c1a8 vnconfig -l: print an error if supplied vn is unknown The code as it is has no effect, because `tmp' is never NULL. Make it behave as initially intended. Also, since we are here replace the printf() call with errx(). Approved-by: corecode@ --- diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c index 66ec175ab8..01a2c0f410 100644 --- a/usr.sbin/vnconfig/vnconfig.c +++ b/usr.sbin/vnconfig/vnconfig.c @@ -290,10 +290,8 @@ getinfo( const char *vname ) } tmp++; } - if (tmp == NULL) { - printf("unknown vn device: %s", vname); - return 1; - } + if (*tmp == '\0') + errx(1, "unknown vn device: %s", vname); } snprintf(vnpath, sizeof(vnpath), "/dev/vn%d", i);