diff options
| author | Philippe Charnier <charnier@FreeBSD.org> | 1998-07-28 06:42:38 +0000 |
|---|---|---|
| committer | Philippe Charnier <charnier@FreeBSD.org> | 1998-07-28 06:42:38 +0000 |
| commit | 14cf3a5d8f07f4a0bb2b08a3a52623dc75831d37 (patch) | |
| tree | 32f3808a26d440184711be8f83021b0b246f3bee | |
| parent | f9b52c93a5d46871aa1569221afc005225cfd399 (diff) | |
Notes
| -rw-r--r-- | sbin/scsi/scsi.8 | 10 | ||||
| -rw-r--r-- | sbin/scsi/scsi.c | 19 |
2 files changed, 18 insertions, 11 deletions
diff --git a/sbin/scsi/scsi.8 b/sbin/scsi/scsi.8 index ff6836c734b6a..f3b1c5dee85a0 100644 --- a/sbin/scsi/scsi.8 +++ b/sbin/scsi/scsi.8 @@ -4,8 +4,8 @@ .\" Permission is granted to use or redistribute this file in any way as long .\" as this notice remains. Julian Elischer does not guarantee that this file .\" is totally correct for any given task and users of this file must -.\" accept responsibility for any damage that occurs from the application of this -.\" file. +.\" accept responsibility for any damage that occurs from the application +.\" of this file. .\" .\" (julian@tfs.com julian@dialix.oz.au) .\" User SCSI hooks added by Peter Dufault: @@ -39,7 +39,7 @@ .\" SUCH DAMAGE. .\" .\" -.\" $Id: scsi.8,v 1.16 1998/01/03 10:11:38 brian Exp $ +.\" $Id: scsi.8,v 1.17 1998/06/03 03:59:00 jkoshy Exp $ .\" .Dd October 11, 1993 .Dt SCSI 8 @@ -292,7 +292,7 @@ variable determines the editor to use for the mode editor. .Xr ssc 4 .Sh BUGS .Pp -Some devices respond to an inquiry for all LUNS. This will cause them +Some devices respond to an inquiry for all LUNs. This will cause them to come on line to 8 times during reprobe to different logical units. .Pp The @@ -302,7 +302,7 @@ option to do an inquiry went away in The new facilities provided by .Fl c -supercede that. +supersede that. .Pp Check your permissions carefully. .Ql scsi -f /dev/rsd0c -c "4 0 0 0 0 0 diff --git a/sbin/scsi/scsi.c b/sbin/scsi/scsi.c index 9a3ac86580d52..4d507fe766edf 100644 --- a/sbin/scsi/scsi.c +++ b/sbin/scsi/scsi.c @@ -4,8 +4,8 @@ * Permission is granted to use or redistribute this file in any way as long * as this notice remains. Julian Elischer does not guarantee that this file * is totally correct for any given task and users of this file must - * accept responsibility for any damage that occurs from the application of this - * file. + * accept responsibility for any damage that occurs from the application + * of this file. * * (julian@tfs.com julian@dialix.oz.au) * @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: scsi.c,v 1.17 1998/01/12 07:57:57 charnier Exp $"; + "$Id: scsi.c,v 1.18 1998/06/28 20:31:48 bde Exp $"; #endif /* not lint */ #include <ctype.h> @@ -91,8 +91,6 @@ void procargs(int *argc_p, char ***argv_p) { int argc = *argc_p; char **argv = *argv_p; - extern char *optarg; - extern int optind; int fflag, ch; @@ -227,6 +225,8 @@ void arg_put(void *hook, int letter, void *arg, int count, char *name) case 'z': { char *p = malloc(count + 1); + if (p == NULL) + errx(1, "malloc failed"); p[count] = 0; strncpy(p, (char *)arg, count); if (letter == 'z') @@ -317,6 +317,8 @@ do_cmd(int fd, char *fmt, int argc, char **argv) data_fmt = cget(&h, 0); scsireq->databuf = malloc(count); + if (scsireq->databuf == NULL) + errx(1, "malloc failed"); if (data_phase == out) { @@ -696,6 +698,8 @@ edit_edit(void) fclose(edit_file); system_line = malloc(strlen(editor) + strlen(edit_name) + 6); + if (system_line == NULL) + errx(1, "malloc failed"); sprintf(system_line, "%s %s", editor, edit_name); system(system_line); free(system_line); @@ -835,9 +839,12 @@ void do_probe_all(void) char vendor_id[8 + 1], product_id[16 + 1], revision[4 + 1]; int id; - u_char *inq_buf = malloc(96); + u_char *inq_buf; struct scsi_addr addr; + inq_buf = malloc(96); + if (inq_buf == NULL) + errx(1, "malloc failed"); scsireq = scsireq_build(scsireq_new(), 96, inq_buf, SCCMD_READ, "12 0 0 0 v 0", 96); |
