From 037bcc8f2068c6e0961b3b5dd7f6fd375dfc0c02 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 10 Apr 2007 15:28:56 +0000 Subject: if vnconfig can't get the info, it should say so, not just print nothing. ok grunk pedro --- usr.sbin/vnconfig/vnconfig.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c index f839c5d810c..fade6e2707c 100644 --- a/usr.sbin/vnconfig/vnconfig.c +++ b/usr.sbin/vnconfig/vnconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnconfig.c,v 1.26 2007/03/14 17:59:41 grunk Exp $ */ +/* $OpenBSD: vnconfig.c,v 1.27 2007/04/10 15:28:55 tedu Exp $ */ /* * Copyright (c) 1993 University of Utah. * Copyright (c) 1990, 1993 @@ -234,8 +234,12 @@ getinfo(const char *vname) query: if (ioctl(vd, VNDIOCGET, &vnu) == -1) { - close(vd); - return (!(errno == ENXIO && print_all)); + if (print_all && errno == ENXIO && vnu.vnu_unit > 0) { + close(vd); + return (0); + } else { + err(1, "ioctl: %s", vname); + } } fprintf(stdout, "vnd%d: ", vnu.vnu_unit); -- cgit v1.2.3