summaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorManuel Novoa III2003-03-19 09:13:01 +0000
committerManuel Novoa III2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /console-tools
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip
busybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
Major coreutils update.
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/chvt.c6
-rw-r--r--console-tools/deallocvt.c10
-rw-r--r--console-tools/dumpkmap.c6
-rw-r--r--console-tools/loadacm.c36
-rw-r--r--console-tools/loadfont.c30
-rw-r--r--console-tools/loadkmap.c10
-rw-r--r--console-tools/openvt.c10
-rw-r--r--console-tools/setkeycodes.c8
8 files changed, 58 insertions, 58 deletions
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index 8136f1c..11e1078 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -23,13 +23,13 @@ int chvt_main(int argc, char **argv)
int fd, num;
if ((argc != 2) || (**(argv + 1) == '-'))
- show_usage();
+ bb_show_usage();
fd = get_console_fd();
num = atoi(argv[1]);
if (ioctl(fd, VT_ACTIVATE, num))
- perror_msg_and_die("VT_ACTIVATE");
+ bb_perror_msg_and_die("VT_ACTIVATE");
if (ioctl(fd, VT_WAITACTIVE, num))
- perror_msg_and_die("VT_WAITACTIVE");
+ bb_perror_msg_and_die("VT_WAITACTIVE");
return EXIT_SUCCESS;
}
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index b7dcc9e..a4ba851 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -19,23 +19,23 @@ int deallocvt_main(int argc, char *argv[])
//if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
if (argc > 2)
- show_usage();
+ bb_show_usage();
fd = get_console_fd();
if (argc == 1) {
/* deallocate all unused consoles */
if (ioctl(fd, VT_DISALLOCATE, 0))
- perror_msg_and_die("VT_DISALLOCATE");
+ bb_perror_msg_and_die("VT_DISALLOCATE");
} else {
for (i = 1; i < argc; i++) {
num = atoi(argv[i]);
if (num == 0)
- error_msg("0: illegal VT number");
+ bb_error_msg("0: illegal VT number");
else if (num == 1)
- error_msg("VT 1 cannot be deallocated");
+ bb_error_msg("VT 1 cannot be deallocated");
else if (ioctl(fd, VT_DISALLOCATE, num))
- perror_msg_and_die("VT_DISALLOCATE");
+ bb_perror_msg_and_die("VT_DISALLOCATE");
}
}
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index d2bb6dc..8592655 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -48,12 +48,12 @@ int dumpkmap_main(int argc, char **argv)
char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
if (argc>=2 && *argv[1]=='-') {
- show_usage();
+ bb_show_usage();
}
fd = open(CURRENT_VC, O_RDWR);
if (fd < 0) {
- perror_msg("Error opening " CURRENT_VC);
+ bb_perror_msg("Error opening " CURRENT_VC);
return EXIT_FAILURE;
}
@@ -81,7 +81,7 @@ int dumpkmap_main(int argc, char **argv)
ke.kb_table = i;
if (ioctl(fd, KDGKBENT, &ke) < 0) {
- error_msg("ioctl returned: %m, %s, %s, %xqq", (char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
+ bb_error_msg("ioctl returned: %m, %s, %s, %xqq", (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 3fb4e76..640aa44 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -34,16 +34,16 @@ int loadacm_main(int argc, char **argv)
int fd;
if (argc>=2 && *argv[1]=='-') {
- show_usage();
+ bb_show_usage();
}
fd = open(CURRENT_VC, O_RDWR);
if (fd < 0) {
- perror_msg_and_die("Error opening " CURRENT_VC);
+ bb_perror_msg_and_die("Error opening " CURRENT_VC);
}
if (screen_map_load(fd, stdin)) {
- perror_msg_and_die("Error loading acm");
+ bb_perror_msg_and_die("Error loading acm");
}
write(fd, "\033(K", 3);
@@ -60,7 +60,7 @@ static int screen_map_load(int fd, FILE * fp)
int is_unicode;
if (fstat(fileno(fp), &stbuf))
- perror_msg_and_die("Cannot stat map file");
+ bb_perror_msg_and_die("Cannot stat map file");
/* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
if (!
@@ -70,16 +70,16 @@ static int screen_map_load(int fd, FILE * fp)
if (parse_failed) {
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
- error_msg_and_die("16bit screen-map MUST be a regular file.");
+ bb_error_msg_and_die("16bit screen-map MUST be a regular file.");
else
- perror_msg_and_die("fseek failed reading binary 16bit screen-map");
+ bb_perror_msg_and_die("fseek failed reading binary 16bit screen-map");
}
if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1)
- perror_msg_and_die("Cannot read [new] map from file");
+ bb_perror_msg_and_die("Cannot read [new] map from file");
#if 0
else
- error_msg("Input screen-map is binary.");
+ bb_error_msg("Input screen-map is binary.");
#endif
}
@@ -87,7 +87,7 @@ static int screen_map_load(int fd, FILE * fp)
/* same if it was binary, ie. if parse_failed */
if (parse_failed || is_unicode) {
if (ioctl(fd, PIO_UNISCRNMAP, wbuf))
- perror_msg_and_die("PIO_UNISCRNMAP ioctl");
+ bb_perror_msg_and_die("PIO_UNISCRNMAP ioctl");
else
return 0;
}
@@ -96,10 +96,10 @@ static int screen_map_load(int fd, FILE * fp)
/* rewind... */
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
- error_msg("Assuming 8bit screen-map - MUST be a regular file."),
+ bb_error_msg("Assuming 8bit screen-map - MUST be a regular file."),
exit(1);
else
- perror_msg_and_die("fseek failed assuming 8bit screen-map");
+ bb_perror_msg_and_die("fseek failed assuming 8bit screen-map");
}
/* ... and try an old 8-bit screen-map */
@@ -109,25 +109,25 @@ static int screen_map_load(int fd, FILE * fp)
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
/* should not - it succedeed above */
- error_msg_and_die("fseek() returned ESPIPE !");
+ bb_error_msg_and_die("fseek() returned ESPIPE !");
else
- perror_msg_and_die("fseek for binary 8bit screen-map");
+ bb_perror_msg_and_die("fseek for binary 8bit screen-map");
}
if (fread(buf, E_TABSZ, 1, fp) != 1)
- perror_msg_and_die("Cannot read [old] map from file");
+ bb_perror_msg_and_die("Cannot read [old] map from file");
#if 0
else
- error_msg("Input screen-map is binary.");
+ bb_error_msg("Input screen-map is binary.");
#endif
}
if (ioctl(fd, PIO_SCRNMAP, buf))
- perror_msg_and_die("PIO_SCRNMAP ioctl");
+ bb_perror_msg_and_die("PIO_SCRNMAP ioctl");
else
return 0;
}
- error_msg("Error parsing symbolic map");
+ bb_error_msg("Error parsing symbolic map");
return(1);
}
@@ -172,7 +172,7 @@ static int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode)
if (feof(fp))
break;
else
- perror_msg_and_die("uni_screen_map_read_ascii() can't read line");
+ bb_perror_msg_and_die("uni_screen_map_read_ascii() can't read line");
}
/* get "charset-relative charcode", stripping leading spaces */
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index d665001..6108151 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -44,11 +44,11 @@ extern int loadfont_main(int argc, char **argv)
int fd;
if (argc != 1)
- show_usage();
+ bb_show_usage();
fd = open(CURRENT_VC, O_RDWR);
if (fd < 0)
- perror_msg_and_die("Error opening " CURRENT_VC);
+ bb_perror_msg_and_die("Error opening " CURRENT_VC);
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)
- error_msg_and_die("Bad character size %d", unit);
+ bb_error_msg_and_die("Bad character size %d", 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 */
- perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)");
+ bb_perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)");
}
#endif
if (ioctl(fd, PIO_FONT, buf))
- perror_msg_and_die("PIO_FONT ioctl error");
+ bb_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) {
- error_msg("It seems this kernel is older than 1.1.92");
- error_msg_and_die("No Unicode mapping table loaded.");
+ bb_error_msg("It seems this kernel is older than 1.1.92");
+ bb_error_msg_and_die("No Unicode mapping table loaded.");
} else
#endif
- perror_msg_and_die("PIO_UNIMAPCLR");
+ bb_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
- perror_msg_and_die("PIO_UNIMAP");
+ bb_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))
- perror_msg_and_die("Error reading input font");
+ bb_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))
- perror_msg_and_die("Font too large");
+ bb_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)
- error_msg_and_die("Unsupported psf file mode");
+ bb_error_msg_and_die("Unsupported psf file mode");
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
#if !defined( PIO_FONTX ) || defined( __sparc__ )
if (fontsize != 256)
- error_msg_and_die("Only fontsize 256 supported");
+ bb_error_msg_and_die("Only fontsize 256 supported");
#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))
- error_msg_and_die("Input file: bad length");
+ bb_error_msg_and_die("Input file: bad length");
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)
- error_msg_and_die("Bad input file size");
+ bb_error_msg_and_die("Bad input file size");
offset = 0;
unit = inputlth / 256;
}
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 4f217d6..f4208df 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -51,18 +51,18 @@ int loadkmap_main(int argc, char **argv)
char flags[MAX_NR_KEYMAPS], buff[7];
if (argc != 1)
- show_usage();
+ bb_show_usage();
fd = open(CURRENT_VC, O_RDWR);
if (fd < 0)
- perror_msg_and_die("Error opening " CURRENT_VC);
+ bb_perror_msg_and_die("Error opening " CURRENT_VC);
read(0, buff, 7);
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
- error_msg_and_die("This is not a valid binary keymap.");
+ bb_error_msg_and_die("This is not a valid binary keymap.");
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
- perror_msg_and_die("Error reading keymap flags");
+ bb_perror_msg_and_die("Error reading keymap flags");
ibuff = (u_short *) xmalloc(ibuffsz);
@@ -71,7 +71,7 @@ int loadkmap_main(int argc, char **argv)
pos = 0;
while (pos < ibuffsz) {
if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0)
- perror_msg_and_die("Error reading keymap");
+ bb_perror_msg_and_die("Error reading keymap");
pos += readsz;
}
for (j = 0; j < NR_KEYS; j++) {
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index 77c8975..5195136 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -43,16 +43,16 @@ int openvt_main(int argc, char **argv)
char * cmd_args = NULL;
if (argc < 3)
- show_usage();
+ bb_show_usage();
if (!isdigit(argv[1][0]))
- show_usage();
+ bb_show_usage();
vtno = (int) atol(argv[1]);
/* if (vtno <= 0 || vtno > 63) */
if (vtno <= 0 || vtno > 12)
- error_msg_and_die("Illegal vt number (%d)", vtno);
+ bb_error_msg_and_die("Illegal vt number (%d)", vtno);
sprintf(vtname, VTNAME, vtno);
@@ -69,13 +69,13 @@ int openvt_main(int argc, char **argv)
if (setsid() < 0) {
#endif
- perror_msg_and_die("Unable to set new session");
+ bb_perror_msg_and_die("Unable to set new session");
}
close(0); /* so that new vt becomes stdin */
/* and grab new one */
if ((fd = open(vtname, O_RDWR)) == -1)
- perror_msg_and_die("could not open %s", vtname);
+ bb_perror_msg_and_die("could not open %s", vtname);
/* Reassign stdout and sterr */
close(1);
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 85612c8..796bab2 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -43,7 +43,7 @@ setkeycodes_main(int argc, char** argv)
struct kbkeycode a;
if (argc % 2 != 1 || argc < 2) {
- show_usage();
+ bb_show_usage();
}
fd = get_console_fd();
@@ -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) {
- error_msg_and_die("error reading SCANCODE: '%s'", argv[1]);
+ bb_error_msg_and_die("error reading SCANCODE: '%s'", argv[1]);
}
if (a.scancode > 127) {
a.scancode -= 0xe000;
a.scancode += 128;
}
if (a.scancode > 255 || a.keycode > 127) {
- error_msg_and_die("SCANCODE or KEYCODE outside bounds");
+ bb_error_msg_and_die("SCANCODE or KEYCODE outside bounds");
}
if (ioctl(fd,KDSETKEYCODE,&a)) {
perror("KDSETKEYCODE");
- error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode);
+ bb_error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode);
}
argc -= 2;
argv += 2;