DragonFly submit List (threaded) for 2009-03
DragonFly BSD
DragonFly submit List (threaded) for 2009-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

vnconfig trivial patch


From: Stathis Kamperis <ekamperi@xxxxxxxxx>
Date: Mon, 30 Mar 2009 16:30:39 +0000

Salute.

In good faith and in my attempt to avoid a faux pas, I hereby ask for
rewiew regarding this trivial patch.
I don't see the purpose of calling anything after an err() call, since
err itself exits (and never fails).

Cheers,
Stathis

diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c
index 81d7000..7222e07 100644
--- a/usr.sbin/vnconfig/vnconfig.c
+++ b/usr.sbin/vnconfig/vnconfig.c
@@ -297,10 +297,8 @@ getinfo( const char *vname )
 	snprintf(vnpath, sizeof(vnpath), "/dev/vn%d", i);

 	vd = open(vnpath, O_RDONLY);
-	if (vd < 0) {
+	if (vd < 0)
 		err(1, "open: %s", vnpath);
-		return 1;
-	}

 	for (; i<printlim; i++) {

@@ -325,9 +323,8 @@ getinfo( const char *vname )
 						continue;
 					}
 					else {
-						err(1, "ioctl: %s", vname);
 						close(vd);
-						return 1;
+						err(1, "ioctl: %s", vname);
 					}
 				}
         		}



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]