summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-08-18 12:53:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-08-18 12:53:23 +0000
commitfe3715c0b28aa86f88137a7152a43e7edb5e99cf (patch)
tree1dc8d73f1712584a5206d12b6e4069e65ac8b089
parent16c022ab453d5dde1be797f48f79758fa077cd5c (diff)
a step towards where dlg is heading next + knf
-rw-r--r--sbin/bioctl/bioctl.813
-rw-r--r--sbin/bioctl/bioctl.c24
2 files changed, 16 insertions, 21 deletions
diff --git a/sbin/bioctl/bioctl.8 b/sbin/bioctl/bioctl.8
index f4a731a433b..4eb10ec9f79 100644
--- a/sbin/bioctl/bioctl.8
+++ b/sbin/bioctl/bioctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bioctl.8,v 1.28 2005/08/18 12:19:08 dlg Exp $
+.\" $OpenBSD: bioctl.8,v 1.29 2005/08/18 12:53:22 deraadt Exp $
.\"
.\" Copyright (c) 2004, 2005 Marco Peereboom
.\"
@@ -34,8 +34,7 @@
.Bk -words
.Op Fl Dhiv
.Op Fl a Ar alarm-function
-.Op Fl b Ar target
-.Op Fl H Ar channel:target[.lun]
+.Op Op Fl bH Ar channel:target[.lun]
.Ar device
.Ek
.Sh DESCRIPTION
@@ -64,12 +63,8 @@ The
may be specified as given above,
or by the first letter only
(e.g. -a e).
-.It Fl b Ar target
-Instructs the slot in the enclosure containing the device specified by
-.Ar target
-to blink.
-.Ar device
-is the enclosure.
+.It Fl b Ar channel:target[.lun]
+Instruct a particular device to blink.
.It Fl D
Enable debug output.
.It Fl H Ar channel:target[.lun]
diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c
index e73bccf8492..98bb8ed4b27 100644
--- a/sbin/bioctl/bioctl.c
+++ b/sbin/bioctl/bioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioctl.c,v 1.32 2005/08/18 12:19:08 dlg Exp $ */
+/* $OpenBSD: bioctl.c,v 1.33 2005/08/18 12:53:22 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
@@ -172,8 +172,8 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-Dhiv] [-a alarm-function] [-b targ]"
- " [-H chan:targ[.lun]] device\n", __progname);
+ fprintf(stderr, "usage: %s [-Dhiv] [-a alarm-function]"
+ " [[-bH] chan:targ[.lun]] device\n", __progname);
exit(1);
}
@@ -191,17 +191,17 @@ str2locator(const char *string, struct locator *location)
lun = strchr(targ, TL_SEP);
if (lun != NULL) {
*lun++ = '\0';
- location->lun = strtonum(lun, 0, 256 /* XXX */, NULL);
+ location->lun = strtonum(lun, 0, 256, NULL);
if (errno)
return (-1);
} else
location->lun = 0;
- location->target = strtonum(targ, 0, 256 /* XXX */, NULL);
+ location->target = strtonum(targ, 0, 256, NULL);
if (errno)
return (-1);
-
- location->channel = strtonum(string, 0, 256 /* XXX */, NULL);
+
+ location->channel = strtonum(string, 0, 256, NULL);
if (errno)
return (-1);
@@ -251,7 +251,7 @@ bio_inq(char *name)
printf("%-7s %-10s %-14s %-8s\n",
"Volume", "Status", "Size", "Device");
}
-
+
switch (bv.bv_status) {
case BIOC_SVONLINE:
status = BIOC_SVONLINE_S;
@@ -405,15 +405,15 @@ bio_alarm(char *arg)
}
}
-void bio_setstate(char *arg)
+void
+bio_setstate(char *arg)
{
- int rv;
struct bioc_setstate bs;
struct locator location;
+ int rv;
if (str2locator(arg, &location) != 0)
errx(1, "invalid channel:target[.lun]");
-
bs.bs_cookie = bl.bl_cookie;
bs.bs_status = BIOC_SSHOTSPARE;
@@ -432,8 +432,8 @@ void
bio_blink(char *arg)
{
struct bioc_blink blink;
- int target, rv;
const char *errstr;
+ int target, rv;
target = strtonum(arg, 0, 255, &errstr);
if (errstr != NULL)