aboutsummaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-07-14 01:51:25 +0000
committerMatt Kraai <kraai@debian.org>2000-07-14 01:51:25 +0000
commitd537a95fdbc0b4a5f38edea8593b4c085fdd7fcb (patch)
tree62127f20fc07758e445d8c4e186306cbe83d77b1 /console-tools
parent4ac6cb534d78d63d7b0a206118c56bad7024b9f8 (diff)
downloadbusybox-d537a95fdbc0b4a5f38edea8593b4c085fdd7fcb.tar.gz
Use errorMsg rather than fprintf.
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/deallocvt.c8
-rw-r--r--console-tools/dumpkmap.c4
-rw-r--r--console-tools/loadacm.c18
-rw-r--r--console-tools/loadfont.c18
-rw-r--r--console-tools/loadkmap.c10
5 files changed, 27 insertions, 31 deletions
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index 53d4d9a7c..906f3a9fa 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -39,14 +39,12 @@ int deallocvt_main(int argc, char *argv[])
for (i = 1; i < argc; i++) {
num = atoi(argv[i]);
if (num == 0)
- fprintf(stderr, "%s: 0: illegal VT number\n", applet_name);
+ errorMsg("0: illegal VT number\n");
else if (num == 1)
- fprintf(stderr, "%s: VT 1 cannot be deallocated\n",
- applet_name);
+ errorMsg("VT 1 cannot be deallocated\n");
else if (ioctl(fd, VT_DISALLOCATE, num)) {
perror("VT_DISALLOCATE");
- fprintf(stderr, "%s: could not deallocate console %d\n",
- applet_name, num);
+ errorMsg("could not deallocate console %d\n", num);
exit( FALSE);
}
}
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index a497a07d1..f18050529 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -58,7 +58,7 @@ int dumpkmap_main(int argc, char **argv)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
- fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
+ errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
return 1;
}
@@ -86,7 +86,7 @@ int dumpkmap_main(int argc, char **argv)
ke.kb_table = i;
if (ioctl(fd, KDGKBENT, &ke) < 0) {
- fprintf(stderr, "ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
+ errorMsg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
}
else {
write(1,&ke.kb_value,2);
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index a64c691d2..9eebf3bb5 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -46,12 +46,12 @@ int loadacm_main(int argc, char **argv)
fd = open("/dev/tty", O_RDWR);
if (fd < 0) {
- fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno));
+ errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
return( FALSE);
}
if (screen_map_load(fd, stdin)) {
- fprintf(stderr, "Error loading acm: %s\n", strerror(errno));
+ errorMsg("Error loading acm: %s\n", strerror(errno));
return( FALSE);
}
@@ -79,8 +79,7 @@ int screen_map_load(int fd, FILE * fp)
if (parse_failed) {
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
- fprintf(stderr,
- "16bit screen-map MUST be a regular file.\n"),
+ errorMsg("16bit screen-map MUST be a regular file.\n"),
exit(1);
else
perror("fseek failed reading binary 16bit screen-map"),
@@ -91,7 +90,7 @@ int screen_map_load(int fd, FILE * fp)
perror("Cannot read [new] map from file"), exit(1);
#if 0
else
- fprintf(stderr, "Input screen-map is binary.\n");
+ errorMsg("Input screen-map is binary.\n");
#endif
}
@@ -108,8 +107,7 @@ int screen_map_load(int fd, FILE * fp)
/* rewind... */
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
- fprintf(stderr,
- "Assuming 8bit screen-map - MUST be a regular file.\n"),
+ errorMsg("Assuming 8bit screen-map - MUST be a regular file.\n"),
exit(1);
else
perror("fseek failed assuming 8bit screen-map"), exit(1);
@@ -122,7 +120,7 @@ int screen_map_load(int fd, FILE * fp)
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
/* should not - it succedeed above */
- fprintf(stderr, "fseek() returned ESPIPE !\n"),
+ errorMsg("fseek() returned ESPIPE !\n"),
exit(1);
else
perror("fseek for binary 8bit screen-map"), exit(1);
@@ -132,7 +130,7 @@ int screen_map_load(int fd, FILE * fp)
perror("Cannot read [old] map from file"), exit(1);
#if 0
else
- fprintf(stderr, "Input screen-map is binary.\n");
+ errorMsg("Input screen-map is binary.\n");
#endif
}
@@ -141,7 +139,7 @@ int screen_map_load(int fd, FILE * fp)
else
return 0;
}
- fprintf(stderr, "Error parsing symbolic map\n");
+ errorMsg("Error parsing symbolic map\n");
return(1);
}
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 7eaf40e82..b3f9f4f11 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -56,7 +56,7 @@ extern int loadfont_main(int argc, char **argv)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
- fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
+ errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
return( FALSE);
}
loadnewfont(fd);
@@ -72,7 +72,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
memset(buf, 0, sizeof(buf));
if (unit < 1 || unit > 32) {
- fprintf(stderr, "Bad character size %d\n", unit);
+ errorMsg("Bad character size %d\n", unit);
exit(1);
}
@@ -112,7 +112,7 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
up = (struct unipair *) malloc(maxct * sizeof(struct unipair));
if (!up) {
- fprintf(stderr, "Out of memory?\n");
+ errorMsg("Out of memory?\n");
exit(1);
}
for (glyph = 0; glyph < fontsize; glyph++) {
@@ -137,8 +137,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
#ifdef ENOIOCTLCMD
if (errno == ENOIOCTLCMD) {
- fprintf(stderr, "It seems this kernel is older than 1.1.92\n");
- fprintf(stderr, "No Unicode mapping table loaded.\n");
+ errorMsg("It seems this kernel is older than 1.1.92\n");
+ errorMsg("No Unicode mapping table loaded.\n");
} else
#endif
perror("PIO_UNIMAPCLR");
@@ -198,13 +198,13 @@ static void loadnewfont(int fd)
goto no_psf;
if (psfhdr.mode > PSF_MAXMODE) {
- fprintf(stderr, "Unsupported psf file mode\n");
+ errorMsg("Unsupported psf file mode\n");
exit(1);
}
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
#if !defined( PIO_FONTX ) || defined( __sparc__ )
if (fontsize != 256) {
- fprintf(stderr, "Only fontsize 256 supported\n");
+ errorMsg("Only fontsize 256 supported\n");
exit(1);
}
#endif
@@ -214,7 +214,7 @@ static void loadnewfont(int fd)
head = head0 + fontsize * unit;
if (head > inputlth || (!hastable && head != inputlth)) {
- fprintf(stderr, "Input file: bad length\n");
+ errorMsg("Input file: bad length\n");
exit(1);
}
do_loadfont(fd, inbuf + head0, unit, fontsize);
@@ -231,7 +231,7 @@ static void loadnewfont(int fd)
} else {
/* bare font */
if (inputlth & 0377) {
- fprintf(stderr, "Bad input file size\n");
+ errorMsg("Bad input file size\n");
exit(1);
}
offset = 0;
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index c2e4c94ed..72247a6e4 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -59,25 +59,25 @@ int loadkmap_main(int argc, char **argv)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
- fprintf(stderr, "Error opening /dev/tty0: %s\n", strerror(errno));
+ errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
exit(FALSE);
}
read(0, buff, 7);
if (0 != strncmp(buff, magic, 7)) {
- fprintf(stderr, "This is not a valid binary keymap.\n");
+ errorMsg("This is not a valid binary keymap.\n");
exit(FALSE);
}
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) {
- fprintf(stderr, "Error reading keymap flags: %s\n",
+ errorMsg("Error reading keymap flags: %s\n",
strerror(errno));
exit(FALSE);
}
ibuff = (u_short *) malloc(ibuffsz);
if (!ibuff) {
- fprintf(stderr, "Out of memory.\n");
+ errorMsg("Out of memory.\n");
exit(FALSE);
}
@@ -87,7 +87,7 @@ int loadkmap_main(int argc, char **argv)
while (pos < ibuffsz) {
if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos))
< 0) {
- fprintf(stderr, "Error reading keymap: %s\n",
+ errorMsg("Error reading keymap: %s\n",
strerror(errno));
exit(FALSE);
}