summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-06-18 06:37:23 +0000
committercharnier <charnier@FreeBSD.org>1997-06-18 06:37:23 +0000
commit67081988839e602766fd4a9312d0885670dc607b (patch)
tree7614e90c60dddd30ce72482bd3ad3d6f4dbf16d9 /sbin
parent8b228a997574abfeed671ebc456ec4e60e8f030d (diff)
downloadFreeBSD-src-67081988839e602766fd4a9312d0885670dc607b.zip
FreeBSD-src-67081988839e602766fd4a9312d0885670dc607b.tar.gz
Various typos in man page. Cosmetic in usage string. Use err(3) instead
of fprintf. Remove unused variables.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/scsi/scsi.814
-rw-r--r--sbin/scsi/scsi.c42
2 files changed, 22 insertions, 34 deletions
diff --git a/sbin/scsi/scsi.8 b/sbin/scsi/scsi.8
index 046b5cc..dc9f6b2 100644
--- a/sbin/scsi/scsi.8
+++ b/sbin/scsi/scsi.8
@@ -39,14 +39,14 @@
.\" SUCH DAMAGE.
.\"
.\"
-.\" $Id: scsi.8,v 1.9 1997/02/22 14:33:15 peter Exp $
+.\" $Id: scsi.8,v 1.10 1997/03/19 22:42:02 mpp Exp $
.\"
.Dd October 11, 1993
.Dt SCSI 8
.Os BSD 4
.Sh NAME
.Nm scsi
-.Nd program to assist with scsi devices.
+.Nd program to assist with scsi devices
.Sh SYNOPSIS
.Nm scsi
.Fl f Ar device
@@ -70,7 +70,7 @@
.Fl r
.Op Fl b Ar bus
.Op Fl t Ar targ
-.Op Fl l lun
+.Op Fl l Ar lun
.Nm scsi
.Fl f Ar device
.Fl c Ar cmd_fmt
@@ -147,8 +147,12 @@ The
option can be used against the "super scsi" device
.Pa /dev/scsi/super
to probe all devices with a given SCSI lun on a given SCSI bus.
-The bus can be selected with the -b option and the default is 0.
-The lun can be selected with the -l option and the default is 0.
+The bus can be selected with the
+.Fl b
+option and the default is 0.
+The lun can be selected with the
+.Fl l
+option and the default is 0.
See
.Xr scsi 4
for a description of the "super scsi" device.
diff --git a/sbin/scsi/scsi.c b/sbin/scsi/scsi.c
index fbd8c6f..fdbb901 100644
--- a/sbin/scsi/scsi.c
+++ b/sbin/scsi/scsi.c
@@ -39,7 +39,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi.c,v 1.14 1997/02/22 14:33:16 peter Exp $
+ * $Id: scsi.c,v 1.15 1997/03/29 03:33:04 imp Exp $
*/
#include <stdio.h>
@@ -52,6 +52,7 @@
#include <scsi.h>
#include <ctype.h>
#include <signal.h>
+#include <err.h>
int fd;
int debuglevel;
@@ -73,26 +74,15 @@ int seconds = 2;
void usage(void)
{
- printf(
-
-"Usage:\n"
-"\n"
-" scsi -f device -d debug_level # To set debug level\n"
-" scsi -f device [-v] -z seconds # To freeze bus\n"
-" scsi -f device -m page [-P pc] # To read mode pages\n"
-" scsi -f device -p [-b bus] [-l lun] # To probe all devices\n"
-" scsi -f device -r [-b bus] [-t targ] [-l lun] # To reprobe a device\n"
-" scsi -f device [-v] [-s seconds] -c cmd_fmt [arg0 ... argn] # A command...\n"
-" -o count out_fmt [arg0 ... argn] # EITHER (data out)\n"
-" -i count in_fmt # OR (data in)\n"
-"\n"
-"\"out_fmt\" can be \"-\" to read output data from stdin;\n"
-"\"in_fmt\" can be \"-\" to write input data to stdout;\n"
-"\n"
-"If debugging is not compiled in the kernel, \"-d\" will have no effect\n"
-
-);
-
+ fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
+ "usage: scsi -f device -d debug_level",
+ " scsi -f device [-v] -z seconds",
+ " scsi -f device -m page [-P pc] [-e]",
+ " scsi -f device -p [-b bus] [-l lun]",
+ " scsi -f device -r [-b bus] [-t targ] [-l lun]",
+ " scsi -f device [-v] [-s seconds] -c cmd_fmt [arg0 ... argn]",
+ " -o count out_fmt [arg0 ... argn]",
+ " -i count in_fmt");
exit (1);
}
@@ -126,12 +116,8 @@ void procargs(int *argc_p, char ***argv_p)
editflag = 1;
break;
case 'f':
- if ((fd = scsi_open(optarg, O_RDWR)) < 0) {
- (void) fprintf(stderr,
- "%s: unable to open device %s: %s\n",
- argv[0], optarg, strerror(errno));
- exit(errno);
- }
+ if ((fd = scsi_open(optarg, O_RDWR)) < 0)
+ err(errno, "unable to open device %s", optarg);
fflag = 1;
break;
case 'd':
@@ -697,7 +683,6 @@ edit_report(void *hook, int letter, void *arg, int count, char *name)
static int
edit_get(void *hook, char *name)
{
- struct get_hook *h = (struct get_hook *)hook;
int arg = editinfo[editind].default_value;
if (editinfo[editind].can_edit) {
@@ -952,7 +937,6 @@ void main(int argc, char **argv)
exit(1);
}
} else if (commandflag) {
- int i;
char *fmt;
if (argc < 1) {
OpenPOWER on IntegriCloud