From: Stathis Kamperis Date: Mon, 2 Mar 2009 09:16:19 +0000 (+0000) Subject: vnconfig -l: handle gracefully missing regular file X-Git-Tag: v2.3.1~229 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2ddea4d51c3fd52031183ecca97ea8ef419d9730 vnconfig -l: handle gracefully missing regular file Check if VNIOCGET failed to retrieve the path of the regular file, that is associated with the respective vn device. If so, treat this kind of error as non-fatal (with respect to the rest of the vn devices). --- diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c index d1f89d15ec..dc84b76a26 100644 --- a/usr.sbin/vnconfig/vnconfig.c +++ b/usr.sbin/vnconfig/vnconfig.c @@ -320,9 +320,17 @@ getinfo( const char *vname ) else { if (ioctl(vd, VNIOCGET, &vnu) == -1) { if (errno != ENXIO) { - err(1, "ioctl: %s", vname); - close(vd); - return 1; + if (*vnu.vnu_file == '\0') { + fprintf(stdout, + "vn%d: ioctl: can't access regular file\n", + vnu.vnu_unit); + continue; + } + else { + err(1, "ioctl: %s", vname); + close(vd); + return 1; + } } }