Fix error messages.

This commit is contained in:
Matt Kraai 2000-10-23 18:03:46 +00:00
parent 2be4797a06
commit 207061ac0d
8 changed files with 46 additions and 46 deletions

View File

@ -1120,11 +1120,11 @@ int in, out; /* input and output file descriptors */
if (res == 3) { if (res == 3) {
errorMsg(memory_exhausted); errorMsg(memory_exhausted);
} else if (res != 0) { } else if (res != 0) {
errorMsg("invalid compressed data--format violated"); errorMsg("invalid compressed data--format violated\n");
} }
} else { } else {
errorMsg("internal error, invalid method"); errorMsg("internal error, invalid method\n");
} }
/* Get the crc and original length */ /* Get the crc and original length */
@ -1153,10 +1153,10 @@ int in, out; /* input and output file descriptors */
/* Validate decompression */ /* Validate decompression */
if (orig_crc != updcrc(outbuf, 0)) { if (orig_crc != updcrc(outbuf, 0)) {
errorMsg("invalid compressed data--crc error"); errorMsg("invalid compressed data--crc error\n");
} }
if (orig_len != (ulg) bytes_out) { if (orig_len != (ulg) bytes_out) {
errorMsg("invalid compressed data--length error"); errorMsg("invalid compressed data--length error\n");
} }
/* Check if there are more entries in a pkzip file */ /* Check if there are more entries in a pkzip file */

View File

@ -1381,7 +1381,7 @@ int length;
(char *) window + start, length) != EQUAL) { (char *) window + start, length) != EQUAL) {
fprintf(stderr, fprintf(stderr,
" start %d, match %d, length %d\n", start, match, length); " start %d, match %d, length %d\n", start, match, length);
errorMsg("invalid match"); errorMsg("invalid match\n");
} }
if (verbose > 1) { if (verbose > 1) {
fprintf(stderr, "\\[%d,%d]", start - match, length); fprintf(stderr, "\\[%d,%d]", start - match, length);
@ -2911,7 +2911,7 @@ int eof; /* true if this is the last block for a file */
#endif #endif
/* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
if (buf == (char *) 0) if (buf == (char *) 0)
errorMsg("block vanished"); errorMsg("block vanished\n");
copy_block(buf, (unsigned) stored_len, 0); /* without header */ copy_block(buf, (unsigned) stored_len, 0); /* without header */
compressed_len = stored_len << 3; compressed_len = stored_len << 3;
@ -3094,7 +3094,7 @@ local void set_file_type()
bin_freq += dyn_ltree[n++].Freq; bin_freq += dyn_ltree[n++].Freq;
*file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
if (*file_type == BINARY && translate_eol) { if (*file_type == BINARY && translate_eol) {
errorMsg("-l used on binary file"); errorMsg("-l used on binary file\n");
} }
} }
@ -3256,7 +3256,7 @@ char *env; /* name of environment variable */
/* Copy the program name first */ /* Copy the program name first */
if (oargc-- < 0) if (oargc-- < 0)
errorMsg("argc<=0"); errorMsg("argc<=0\n");
*(nargv++) = *(oargv++); *(nargv++) = *(oargv++);
/* Then copy the environment args */ /* Then copy the environment args */

View File

@ -810,7 +810,7 @@ static int md5_check(const char *checkfile_name)
free(line); free(line);
if (ferror(checkfile_stream)) { if (ferror(checkfile_stream)) {
errorMsg("%s: read error", checkfile_name); /* */ errorMsg("%s: read error\n", checkfile_name); /* */
return FALSE; return FALSE;
} }
@ -991,12 +991,12 @@ int md5sum_main(int argc,
} }
if (fclose (stdout) == EOF) { if (fclose (stdout) == EOF) {
errorMsg("write error"); errorMsg("write error\n");
exit FALSE; exit FALSE;
} }
if (have_read_stdin && fclose (stdin) == EOF) { if (have_read_stdin && fclose (stdin) == EOF) {
errorMsg("standard input"); errorMsg("standard input\n");
exit FALSE; exit FALSE;
} }

View File

@ -1120,11 +1120,11 @@ int in, out; /* input and output file descriptors */
if (res == 3) { if (res == 3) {
errorMsg(memory_exhausted); errorMsg(memory_exhausted);
} else if (res != 0) { } else if (res != 0) {
errorMsg("invalid compressed data--format violated"); errorMsg("invalid compressed data--format violated\n");
} }
} else { } else {
errorMsg("internal error, invalid method"); errorMsg("internal error, invalid method\n");
} }
/* Get the crc and original length */ /* Get the crc and original length */
@ -1153,10 +1153,10 @@ int in, out; /* input and output file descriptors */
/* Validate decompression */ /* Validate decompression */
if (orig_crc != updcrc(outbuf, 0)) { if (orig_crc != updcrc(outbuf, 0)) {
errorMsg("invalid compressed data--crc error"); errorMsg("invalid compressed data--crc error\n");
} }
if (orig_len != (ulg) bytes_out) { if (orig_len != (ulg) bytes_out) {
errorMsg("invalid compressed data--length error"); errorMsg("invalid compressed data--length error\n");
} }
/* Check if there are more entries in a pkzip file */ /* Check if there are more entries in a pkzip file */

8
gzip.c
View File

@ -1381,7 +1381,7 @@ int length;
(char *) window + start, length) != EQUAL) { (char *) window + start, length) != EQUAL) {
fprintf(stderr, fprintf(stderr,
" start %d, match %d, length %d\n", start, match, length); " start %d, match %d, length %d\n", start, match, length);
errorMsg("invalid match"); errorMsg("invalid match\n");
} }
if (verbose > 1) { if (verbose > 1) {
fprintf(stderr, "\\[%d,%d]", start - match, length); fprintf(stderr, "\\[%d,%d]", start - match, length);
@ -2911,7 +2911,7 @@ int eof; /* true if this is the last block for a file */
#endif #endif
/* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
if (buf == (char *) 0) if (buf == (char *) 0)
errorMsg("block vanished"); errorMsg("block vanished\n");
copy_block(buf, (unsigned) stored_len, 0); /* without header */ copy_block(buf, (unsigned) stored_len, 0); /* without header */
compressed_len = stored_len << 3; compressed_len = stored_len << 3;
@ -3094,7 +3094,7 @@ local void set_file_type()
bin_freq += dyn_ltree[n++].Freq; bin_freq += dyn_ltree[n++].Freq;
*file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII;
if (*file_type == BINARY && translate_eol) { if (*file_type == BINARY && translate_eol) {
errorMsg("-l used on binary file"); errorMsg("-l used on binary file\n");
} }
} }
@ -3256,7 +3256,7 @@ char *env; /* name of environment variable */
/* Copy the program name first */ /* Copy the program name first */
if (oargc-- < 0) if (oargc-- < 0)
errorMsg("argc<=0"); errorMsg("argc<=0\n");
*(nargv++) = *(oargv++); *(nargv++) = *(oargv++);
/* Then copy the environment args */ /* Then copy the environment args */

View File

@ -77,7 +77,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1 #define MODUTILS_MODULE_H 1
#ident "$Id: insmod.c,v 1.27 2000/10/23 17:55:27 kraai Exp $" #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -283,7 +283,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1 #define MODUTILS_OBJ_H 1
#ident "$Id: insmod.c,v 1.27 2000/10/23 17:55:27 kraai Exp $" #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -1456,7 +1456,7 @@ static int old_get_kernel_symbols(const char *m_name)
nks = get_kernel_syms(NULL); nks = get_kernel_syms(NULL);
if (nks < 0) { if (nks < 0) {
errorMsg("get_kernel_syms: %s: %s", m_name, strerror(errno)); errorMsg("get_kernel_syms: %s: %s\n", m_name, strerror(errno));
return 0; return 0;
} }
@ -1637,7 +1637,7 @@ old_init_module(const char *m_name, struct obj_file *f,
m_size | (flag_autoclean ? OLD_MOD_AUTOCLEAN m_size | (flag_autoclean ? OLD_MOD_AUTOCLEAN
: 0), &routines, symtab); : 0), &routines, symtab);
if (ret) if (ret)
errorMsg("init_module: %s: %s", m_name, strerror(errno)); errorMsg("init_module: %s: %s\n", m_name, strerror(errno));
free(image); free(image);
free(symtab); free(symtab);
@ -1949,7 +1949,7 @@ static int new_get_kernel_symbols(void)
module_names = xrealloc(module_names, bufsize = ret); module_names = xrealloc(module_names, bufsize = ret);
goto retry_modules_load; goto retry_modules_load;
} }
errorMsg("QM_MODULES: %s", strerror(errno)); errorMsg("QM_MODULES: %s\n", strerror(errno));
return 0; return 0;
} }
@ -1968,7 +1968,7 @@ static int new_get_kernel_symbols(void)
/* The module was removed out from underneath us. */ /* The module was removed out from underneath us. */
continue; continue;
} }
errorMsg("query_module: QM_INFO: %s: %s", mn, strerror(errno)); errorMsg("query_module: QM_INFO: %s: %s\n", mn, strerror(errno));
return 0; return 0;
} }
@ -1983,7 +1983,7 @@ static int new_get_kernel_symbols(void)
/* The module was removed out from underneath us. */ /* The module was removed out from underneath us. */
continue; continue;
default: default:
errorMsg("query_module: QM_SYMBOLS: %s: %s", mn, strerror(errno)); errorMsg("query_module: QM_SYMBOLS: %s: %s\n", mn, strerror(errno));
return 0; return 0;
} }
} }
@ -2008,7 +2008,7 @@ static int new_get_kernel_symbols(void)
syms = xrealloc(syms, bufsize = ret); syms = xrealloc(syms, bufsize = ret);
goto retry_kern_sym_load; goto retry_kern_sym_load;
} }
errorMsg("kernel: QM_SYMBOLS: %s", strerror(errno)); errorMsg("kernel: QM_SYMBOLS: %s\n", strerror(errno));
return 0; return 0;
} }
nksyms = nsyms = ret; nksyms = nsyms = ret;
@ -2189,7 +2189,7 @@ new_init_module(const char *m_name, struct obj_file *f,
ret = new_sys_init_module(m_name, (struct new_module *) image); ret = new_sys_init_module(m_name, (struct new_module *) image);
if (ret) if (ret)
errorMsg("init_module: %s: %s", m_name, strerror(errno)); errorMsg("init_module: %s: %s\n", m_name, strerror(errno));
free(image); free(image);
@ -2569,7 +2569,7 @@ struct obj_file *obj_load(FILE * fp)
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
if (fread(&f->header, sizeof(f->header), 1, fp) != 1) { if (fread(&f->header, sizeof(f->header), 1, fp) != 1) {
errorMsg("error reading ELF header: %s", strerror(errno)); errorMsg("error reading ELF header: %s\n", strerror(errno));
return NULL; return NULL;
} }
@ -2608,7 +2608,7 @@ struct obj_file *obj_load(FILE * fp)
section_headers = alloca(sizeof(ElfW(Shdr)) * shnum); section_headers = alloca(sizeof(ElfW(Shdr)) * shnum);
fseek(fp, f->header.e_shoff, SEEK_SET); fseek(fp, f->header.e_shoff, SEEK_SET);
if (fread(section_headers, sizeof(ElfW(Shdr)), shnum, fp) != shnum) { if (fread(section_headers, sizeof(ElfW(Shdr)), shnum, fp) != shnum) {
errorMsg("error reading ELF section headers: %s", strerror(errno)); errorMsg("error reading ELF section headers: %s\n", strerror(errno));
return NULL; return NULL;
} }
@ -2638,7 +2638,7 @@ struct obj_file *obj_load(FILE * fp)
sec->contents = xmalloc(sec->header.sh_size); sec->contents = xmalloc(sec->header.sh_size);
fseek(fp, sec->header.sh_offset, SEEK_SET); fseek(fp, sec->header.sh_offset, SEEK_SET);
if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) {
errorMsg("error reading ELF section data: %s", strerror(errno)); errorMsg("error reading ELF section data: %s\n", strerror(errno));
return NULL; return NULL;
} }
} else { } else {

View File

@ -810,7 +810,7 @@ static int md5_check(const char *checkfile_name)
free(line); free(line);
if (ferror(checkfile_stream)) { if (ferror(checkfile_stream)) {
errorMsg("%s: read error", checkfile_name); /* */ errorMsg("%s: read error\n", checkfile_name); /* */
return FALSE; return FALSE;
} }
@ -991,12 +991,12 @@ int md5sum_main(int argc,
} }
if (fclose (stdout) == EOF) { if (fclose (stdout) == EOF) {
errorMsg("write error"); errorMsg("write error\n");
exit FALSE; exit FALSE;
} }
if (have_read_stdin && fclose (stdin) == EOF) { if (have_read_stdin && fclose (stdin) == EOF) {
errorMsg("standard input"); errorMsg("standard input\n");
exit FALSE; exit FALSE;
} }

View File

@ -77,7 +77,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1 #define MODUTILS_MODULE_H 1
#ident "$Id: insmod.c,v 1.27 2000/10/23 17:55:27 kraai Exp $" #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -283,7 +283,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1 #define MODUTILS_OBJ_H 1
#ident "$Id: insmod.c,v 1.27 2000/10/23 17:55:27 kraai Exp $" #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -1456,7 +1456,7 @@ static int old_get_kernel_symbols(const char *m_name)
nks = get_kernel_syms(NULL); nks = get_kernel_syms(NULL);
if (nks < 0) { if (nks < 0) {
errorMsg("get_kernel_syms: %s: %s", m_name, strerror(errno)); errorMsg("get_kernel_syms: %s: %s\n", m_name, strerror(errno));
return 0; return 0;
} }
@ -1637,7 +1637,7 @@ old_init_module(const char *m_name, struct obj_file *f,
m_size | (flag_autoclean ? OLD_MOD_AUTOCLEAN m_size | (flag_autoclean ? OLD_MOD_AUTOCLEAN
: 0), &routines, symtab); : 0), &routines, symtab);
if (ret) if (ret)
errorMsg("init_module: %s: %s", m_name, strerror(errno)); errorMsg("init_module: %s: %s\n", m_name, strerror(errno));
free(image); free(image);
free(symtab); free(symtab);
@ -1949,7 +1949,7 @@ static int new_get_kernel_symbols(void)
module_names = xrealloc(module_names, bufsize = ret); module_names = xrealloc(module_names, bufsize = ret);
goto retry_modules_load; goto retry_modules_load;
} }
errorMsg("QM_MODULES: %s", strerror(errno)); errorMsg("QM_MODULES: %s\n", strerror(errno));
return 0; return 0;
} }
@ -1968,7 +1968,7 @@ static int new_get_kernel_symbols(void)
/* The module was removed out from underneath us. */ /* The module was removed out from underneath us. */
continue; continue;
} }
errorMsg("query_module: QM_INFO: %s: %s", mn, strerror(errno)); errorMsg("query_module: QM_INFO: %s: %s\n", mn, strerror(errno));
return 0; return 0;
} }
@ -1983,7 +1983,7 @@ static int new_get_kernel_symbols(void)
/* The module was removed out from underneath us. */ /* The module was removed out from underneath us. */
continue; continue;
default: default:
errorMsg("query_module: QM_SYMBOLS: %s: %s", mn, strerror(errno)); errorMsg("query_module: QM_SYMBOLS: %s: %s\n", mn, strerror(errno));
return 0; return 0;
} }
} }
@ -2008,7 +2008,7 @@ static int new_get_kernel_symbols(void)
syms = xrealloc(syms, bufsize = ret); syms = xrealloc(syms, bufsize = ret);
goto retry_kern_sym_load; goto retry_kern_sym_load;
} }
errorMsg("kernel: QM_SYMBOLS: %s", strerror(errno)); errorMsg("kernel: QM_SYMBOLS: %s\n", strerror(errno));
return 0; return 0;
} }
nksyms = nsyms = ret; nksyms = nsyms = ret;
@ -2189,7 +2189,7 @@ new_init_module(const char *m_name, struct obj_file *f,
ret = new_sys_init_module(m_name, (struct new_module *) image); ret = new_sys_init_module(m_name, (struct new_module *) image);
if (ret) if (ret)
errorMsg("init_module: %s: %s", m_name, strerror(errno)); errorMsg("init_module: %s: %s\n", m_name, strerror(errno));
free(image); free(image);
@ -2569,7 +2569,7 @@ struct obj_file *obj_load(FILE * fp)
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
if (fread(&f->header, sizeof(f->header), 1, fp) != 1) { if (fread(&f->header, sizeof(f->header), 1, fp) != 1) {
errorMsg("error reading ELF header: %s", strerror(errno)); errorMsg("error reading ELF header: %s\n", strerror(errno));
return NULL; return NULL;
} }
@ -2608,7 +2608,7 @@ struct obj_file *obj_load(FILE * fp)
section_headers = alloca(sizeof(ElfW(Shdr)) * shnum); section_headers = alloca(sizeof(ElfW(Shdr)) * shnum);
fseek(fp, f->header.e_shoff, SEEK_SET); fseek(fp, f->header.e_shoff, SEEK_SET);
if (fread(section_headers, sizeof(ElfW(Shdr)), shnum, fp) != shnum) { if (fread(section_headers, sizeof(ElfW(Shdr)), shnum, fp) != shnum) {
errorMsg("error reading ELF section headers: %s", strerror(errno)); errorMsg("error reading ELF section headers: %s\n", strerror(errno));
return NULL; return NULL;
} }
@ -2638,7 +2638,7 @@ struct obj_file *obj_load(FILE * fp)
sec->contents = xmalloc(sec->header.sh_size); sec->contents = xmalloc(sec->header.sh_size);
fseek(fp, sec->header.sh_offset, SEEK_SET); fseek(fp, sec->header.sh_offset, SEEK_SET);
if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) {
errorMsg("error reading ELF section data: %s", strerror(errno)); errorMsg("error reading ELF section data: %s\n", strerror(errno));
return NULL; return NULL;
} }
} else { } else {