From 2ddea4d51c3fd52031183ecca97ea8ef419d9730 Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Mon, 2 Mar 2009 09:16:19 +0000 Subject: [PATCH] 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). --- usr.sbin/vnconfig/vnconfig.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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; + } } } -- 2.41.0