Spelling. Errx() on malloc() failure.

This commit is contained in:
charnier 1998-07-28 06:42:38 +00:00
parent f12208ec5e
commit 4c2797a436
2 changed files with 18 additions and 11 deletions

View File

@ -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

View File

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