summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot/softraid.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2013-12-28 11:26:57 +0000
committerjsing <jsing@openbsd.org>2013-12-28 11:26:57 +0000
commit808c65001a8f417e47b5d11110894acfa47f0f8a (patch)
treeadc1ef26254f6709484ba7afbd55841a56d3b7a0 /usr.sbin/installboot/softraid.c
parentTweak makefiles so that we pull in source files based on defines. (diff)
downloadwireguard-openbsd-808c65001a8f417e47b5d11110894acfa47f0f8a.tar.xz
wireguard-openbsd-808c65001a8f417e47b5d11110894acfa47f0f8a.zip
Various code clean ups - add a missing header, add a missing prototype,
add some casts, tweak some types and variable names.
Diffstat (limited to 'usr.sbin/installboot/softraid.c')
-rw-r--r--usr.sbin/installboot/softraid.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.sbin/installboot/softraid.c b/usr.sbin/installboot/softraid.c
index e155cbd1c04..41e755e2bc0 100644
--- a/usr.sbin/installboot/softraid.c
+++ b/usr.sbin/installboot/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.1 2013/12/27 13:52:40 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.2 2013/12/28 11:26:57 jsing Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
*
@@ -53,7 +53,7 @@ sr_volume(int devfd, char *dev, int *vol, int *disks)
{
struct bioc_inq bi;
struct bioc_vol bv;
- int rv, i;
+ int i;
/*
* Determine if the given device is a softraid volume.
@@ -61,8 +61,7 @@ sr_volume(int devfd, char *dev, int *vol, int *disks)
/* Get volume information. */
memset(&bi, 0, sizeof(bi));
- rv = ioctl(devfd, BIOCINQ, &bi);
- if (rv == -1)
+ if (ioctl(devfd, BIOCINQ, &bi) == -1)
return 0;
/* XXX - softraid volumes will always have a "softraid0" controller. */
@@ -78,8 +77,7 @@ sr_volume(int devfd, char *dev, int *vol, int *disks)
for (i = 0; i < bi.bi_novol; i++) {
memset(&bv, 0, sizeof(bv));
bv.bv_volid = i;
- rv = ioctl(devfd, BIOCVOL, &bv);
- if (rv == -1)
+ if (ioctl(devfd, BIOCVOL, &bv) == -1)
err(1, "BIOCVOL");
if (strncmp(dev, bv.bv_dev, sizeof(bv.bv_dev)) == 0) {