diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2007-04-10 15:28:56 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2007-04-10 15:28:56 +0000 |
commit | 037bcc8f2068c6e0961b3b5dd7f6fd375dfc0c02 (patch) | |
tree | 0af0656775d52a578ccf56757336f82c6987ae49 | |
parent | 95d71d8d904cc43413c7132d89519a4a84df7a30 (diff) |
if vnconfig can't get the info, it should say so, not just print nothing.
ok grunk pedro
-rw-r--r-- | usr.sbin/vnconfig/vnconfig.c | 10 |
1 files 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); |