summaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/deallocvt.c6
-rw-r--r--console-tools/dumpkmap.c4
-rw-r--r--console-tools/loadacm.c16
-rw-r--r--console-tools/loadfont.c28
-rw-r--r--console-tools/loadkmap.c8
-rw-r--r--console-tools/setkeycodes.c6
6 files changed, 34 insertions, 34 deletions
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index 4600c0d..ebdce7b 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -35,12 +35,12 @@ printf("erik: B\n");
for (i = 1; i < argc; i++) {
num = atoi(argv[i]);
if (num == 0)
- errorMsg("0: illegal VT number\n");
+ error_msg("0: illegal VT number\n");
else if (num == 1)
- errorMsg("VT 1 cannot be deallocated\n");
+ error_msg("VT 1 cannot be deallocated\n");
else if (ioctl(fd, VT_DISALLOCATE, num)) {
perror("VT_DISALLOCATE");
- fatalError("could not deallocate console %d\n", num);
+ error_msg_and_die("could not deallocate console %d\n", num);
}
}
printf("erik: C\n");
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index 77689fc..3ff5ef6 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -50,7 +50,7 @@ int dumpkmap_main(int argc, char **argv)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
- errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
+ error_msg("Error opening /dev/tty0: %s\n", strerror(errno));
return EXIT_FAILURE;
}
@@ -78,7 +78,7 @@ int dumpkmap_main(int argc, char **argv)
ke.kb_table = i;
if (ioctl(fd, KDGKBENT, &ke) < 0) {
- errorMsg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
+ error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
}
else {
write(1,(void*)&ke.kb_value,2);
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index 1562108..a696640 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -39,12 +39,12 @@ int loadacm_main(int argc, char **argv)
fd = open("/dev/tty", O_RDWR);
if (fd < 0) {
- errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
+ error_msg("Error opening /dev/tty1: %s\n", strerror(errno));
return EXIT_FAILURE;
}
if (screen_map_load(fd, stdin)) {
- errorMsg("Error loading acm: %s\n", strerror(errno));
+ error_msg("Error loading acm: %s\n", strerror(errno));
return EXIT_FAILURE;
}
@@ -72,7 +72,7 @@ int screen_map_load(int fd, FILE * fp)
if (parse_failed) {
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
- errorMsg("16bit screen-map MUST be a regular file.\n"),
+ error_msg("16bit screen-map MUST be a regular file.\n"),
exit(1);
else
perror("fseek failed reading binary 16bit screen-map"),
@@ -83,7 +83,7 @@ int screen_map_load(int fd, FILE * fp)
perror("Cannot read [new] map from file"), exit(1);
#if 0
else
- errorMsg("Input screen-map is binary.\n");
+ error_msg("Input screen-map is binary.\n");
#endif
}
@@ -100,7 +100,7 @@ int screen_map_load(int fd, FILE * fp)
/* rewind... */
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
- errorMsg("Assuming 8bit screen-map - MUST be a regular file.\n"),
+ error_msg("Assuming 8bit screen-map - MUST be a regular file.\n"),
exit(1);
else
perror("fseek failed assuming 8bit screen-map"), exit(1);
@@ -113,7 +113,7 @@ int screen_map_load(int fd, FILE * fp)
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
/* should not - it succedeed above */
- errorMsg("fseek() returned ESPIPE !\n"),
+ error_msg("fseek() returned ESPIPE !\n"),
exit(1);
else
perror("fseek for binary 8bit screen-map"), exit(1);
@@ -123,7 +123,7 @@ int screen_map_load(int fd, FILE * fp)
perror("Cannot read [old] map from file"), exit(1);
#if 0
else
- errorMsg("Input screen-map is binary.\n");
+ error_msg("Input screen-map is binary.\n");
#endif
}
@@ -132,7 +132,7 @@ int screen_map_load(int fd, FILE * fp)
else
return 0;
}
- errorMsg("Error parsing symbolic map\n");
+ error_msg("Error parsing symbolic map\n");
return(1);
}
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index f69f52f..13a196f 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -48,7 +48,7 @@ extern int loadfont_main(int argc, char **argv)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
- fatalPerror("Error opening /dev/tty0");
+ perror_msg_and_die("Error opening /dev/tty0");
loadnewfont(fd);
return EXIT_SUCCESS;
@@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
memset(buf, 0, sizeof(buf));
if (unit < 1 || unit > 32)
- fatalError("Bad character size %d\n", unit);
+ error_msg_and_die("Bad character size %d\n", unit);
for (i = 0; i < fontsize; i++)
memcpy(buf + (32 * i), inbuf + (unit * i), unit);
@@ -77,11 +77,11 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
if (ioctl(fd, PIO_FONTX, &cfd) == 0)
return; /* success */
- perrorMsg("PIO_FONTX ioctl error (trying PIO_FONT)");
+ perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)");
}
#endif
if (ioctl(fd, PIO_FONT, buf))
- fatalPerror("PIO_FONT ioctl error");
+ perror_msg_and_die("PIO_FONT ioctl error");
}
static void
@@ -119,11 +119,11 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
#ifdef ENOIOCTLCMD
if (errno == ENOIOCTLCMD) {
- errorMsg("It seems this kernel is older than 1.1.92\n");
- fatalError("No Unicode mapping table loaded.\n");
+ error_msg("It seems this kernel is older than 1.1.92\n");
+ error_msg_and_die("No Unicode mapping table loaded.\n");
} else
#endif
- fatalPerror("PIO_UNIMAPCLR");
+ perror_msg_and_die("PIO_UNIMAPCLR");
}
ud.entry_ct = ct;
ud.entries = up;
@@ -133,7 +133,7 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
/* change advice parameters */
}
#endif
- fatalPerror("PIO_UNIMAP");
+ perror_msg_and_die("PIO_UNIMAP");
}
}
@@ -150,13 +150,13 @@ static void loadnewfont(int fd)
*/
inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
if (ferror(stdin))
- fatalPerror("Error reading input font");
+ perror_msg_and_die("Error reading input font");
/* use malloc/realloc in case of giant files;
maybe these do not occur: 16kB for the font,
and 16kB for the map leaves 32 unicode values
for each font position */
if (!feof(stdin))
- fatalPerror("Font too large");
+ perror_msg_and_die("Font too large");
/* test for psf first */
{
@@ -174,11 +174,11 @@ static void loadnewfont(int fd)
goto no_psf;
if (psfhdr.mode > PSF_MAXMODE)
- fatalError("Unsupported psf file mode\n");
+ error_msg_and_die("Unsupported psf file mode\n");
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
#if !defined( PIO_FONTX ) || defined( __sparc__ )
if (fontsize != 256)
- fatalError("Only fontsize 256 supported\n");
+ error_msg_and_die("Only fontsize 256 supported\n");
#endif
hastable = (psfhdr.mode & PSF_MODEHASTAB);
unit = psfhdr.charsize;
@@ -186,7 +186,7 @@ static void loadnewfont(int fd)
head = head0 + fontsize * unit;
if (head > inputlth || (!hastable && head != inputlth))
- fatalError("Input file: bad length\n");
+ error_msg_and_die("Input file: bad length\n");
do_loadfont(fd, inbuf + head0, unit, fontsize);
if (hastable)
do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
@@ -201,7 +201,7 @@ static void loadnewfont(int fd)
} else {
/* bare font */
if (inputlth & 0377)
- fatalError("Bad input file size\n");
+ error_msg_and_die("Bad input file size\n");
offset = 0;
unit = inputlth / 256;
}
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 7dfa670..fc24398 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -52,14 +52,14 @@ int loadkmap_main(int argc, char **argv)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
- fatalPerror("Error opening /dev/tty0");
+ perror_msg_and_die("Error opening /dev/tty0");
read(0, buff, 7);
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
- fatalError("This is not a valid binary keymap.\n");
+ error_msg_and_die("This is not a valid binary keymap.\n");
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
- fatalPerror("Error reading keymap flags");
+ perror_msg_and_die("Error reading keymap flags");
ibuff = (u_short *) xmalloc(ibuffsz);
@@ -68,7 +68,7 @@ int loadkmap_main(int argc, char **argv)
pos = 0;
while (pos < ibuffsz) {
if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0)
- fatalPerror("Error reading keymap");
+ perror_msg_and_die("Error reading keymap");
pos += readsz;
}
for (j = 0; j < NR_KEYS; j++) {
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 6a31e04..7db398d 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv)
a.keycode = atoi(argv[2]);
a.scancode = sc = strtol(argv[1], &ep, 16);
if (*ep) {
- fatalError("error reading SCANCODE: '%s'\n", argv[1]);
+ error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]);
}
if (a.scancode > 127) {
a.scancode -= 0xe000;
a.scancode += 128;
}
if (a.scancode > 255 || a.keycode > 127) {
- fatalError("SCANCODE or KEYCODE outside bounds\n");
+ error_msg_and_die("SCANCODE or KEYCODE outside bounds\n");
}
if (ioctl(fd,KDSETKEYCODE,&a)) {
perror("KDSETKEYCODE");
- fatalError("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode);
+ error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode);
}
argc -= 2;
argv += 2;