Bug #1326

vnconfig trivial patch

Added by Beket over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

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);
}
}
}

History

#1 Updated by Beket over 5 years ago

Dillon commented on it at #dragonflybsd.

Thanks, committed.

Also available in: Atom PDF