aboutsummaryrefslogtreecommitdiff
path: root/console-tools/loadacm.c
diff options
context:
space:
mode:
Diffstat (limited to 'console-tools/loadacm.c')
-rw-r--r--console-tools/loadacm.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index 3fb4e7665..640aa4401 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -34,16 +34,16 @@ int loadacm_main(int argc, char **argv)
34 int fd; 34 int fd;
35 35
36 if (argc>=2 && *argv[1]=='-') { 36 if (argc>=2 && *argv[1]=='-') {
37 show_usage(); 37 bb_show_usage();
38 } 38 }
39 39
40 fd = open(CURRENT_VC, O_RDWR); 40 fd = open(CURRENT_VC, O_RDWR);
41 if (fd < 0) { 41 if (fd < 0) {
42 perror_msg_and_die("Error opening " CURRENT_VC); 42 bb_perror_msg_and_die("Error opening " CURRENT_VC);
43 } 43 }
44 44
45 if (screen_map_load(fd, stdin)) { 45 if (screen_map_load(fd, stdin)) {
46 perror_msg_and_die("Error loading acm"); 46 bb_perror_msg_and_die("Error loading acm");
47 } 47 }
48 48
49 write(fd, "\033(K", 3); 49 write(fd, "\033(K", 3);
@@ -60,7 +60,7 @@ static int screen_map_load(int fd, FILE * fp)
60 int is_unicode; 60 int is_unicode;
61 61
62 if (fstat(fileno(fp), &stbuf)) 62 if (fstat(fileno(fp), &stbuf))
63 perror_msg_and_die("Cannot stat map file"); 63 bb_perror_msg_and_die("Cannot stat map file");
64 64
65 /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */ 65 /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
66 if (! 66 if (!
@@ -70,16 +70,16 @@ static int screen_map_load(int fd, FILE * fp)
70 if (parse_failed) { 70 if (parse_failed) {
71 if (-1 == fseek(fp, 0, SEEK_SET)) { 71 if (-1 == fseek(fp, 0, SEEK_SET)) {
72 if (errno == ESPIPE) 72 if (errno == ESPIPE)
73 error_msg_and_die("16bit screen-map MUST be a regular file."); 73 bb_error_msg_and_die("16bit screen-map MUST be a regular file.");
74 else 74 else
75 perror_msg_and_die("fseek failed reading binary 16bit screen-map"); 75 bb_perror_msg_and_die("fseek failed reading binary 16bit screen-map");
76 } 76 }
77 77
78 if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1) 78 if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1)
79 perror_msg_and_die("Cannot read [new] map from file"); 79 bb_perror_msg_and_die("Cannot read [new] map from file");
80#if 0 80#if 0
81 else 81 else
82 error_msg("Input screen-map is binary."); 82 bb_error_msg("Input screen-map is binary.");
83#endif 83#endif
84 } 84 }
85 85
@@ -87,7 +87,7 @@ static int screen_map_load(int fd, FILE * fp)
87 /* same if it was binary, ie. if parse_failed */ 87 /* same if it was binary, ie. if parse_failed */
88 if (parse_failed || is_unicode) { 88 if (parse_failed || is_unicode) {
89 if (ioctl(fd, PIO_UNISCRNMAP, wbuf)) 89 if (ioctl(fd, PIO_UNISCRNMAP, wbuf))
90 perror_msg_and_die("PIO_UNISCRNMAP ioctl"); 90 bb_perror_msg_and_die("PIO_UNISCRNMAP ioctl");
91 else 91 else
92 return 0; 92 return 0;
93 } 93 }
@@ -96,10 +96,10 @@ static int screen_map_load(int fd, FILE * fp)
96 /* rewind... */ 96 /* rewind... */
97 if (-1 == fseek(fp, 0, SEEK_SET)) { 97 if (-1 == fseek(fp, 0, SEEK_SET)) {
98 if (errno == ESPIPE) 98 if (errno == ESPIPE)
99 error_msg("Assuming 8bit screen-map - MUST be a regular file."), 99 bb_error_msg("Assuming 8bit screen-map - MUST be a regular file."),
100 exit(1); 100 exit(1);
101 else 101 else
102 perror_msg_and_die("fseek failed assuming 8bit screen-map"); 102 bb_perror_msg_and_die("fseek failed assuming 8bit screen-map");
103 } 103 }
104 104
105 /* ... and try an old 8-bit screen-map */ 105 /* ... and try an old 8-bit screen-map */
@@ -109,25 +109,25 @@ static int screen_map_load(int fd, FILE * fp)
109 if (-1 == fseek(fp, 0, SEEK_SET)) { 109 if (-1 == fseek(fp, 0, SEEK_SET)) {
110 if (errno == ESPIPE) 110 if (errno == ESPIPE)
111 /* should not - it succedeed above */ 111 /* should not - it succedeed above */
112 error_msg_and_die("fseek() returned ESPIPE !"); 112 bb_error_msg_and_die("fseek() returned ESPIPE !");
113 else 113 else
114 perror_msg_and_die("fseek for binary 8bit screen-map"); 114 bb_perror_msg_and_die("fseek for binary 8bit screen-map");
115 } 115 }
116 116
117 if (fread(buf, E_TABSZ, 1, fp) != 1) 117 if (fread(buf, E_TABSZ, 1, fp) != 1)
118 perror_msg_and_die("Cannot read [old] map from file"); 118 bb_perror_msg_and_die("Cannot read [old] map from file");
119#if 0 119#if 0
120 else 120 else
121 error_msg("Input screen-map is binary."); 121 bb_error_msg("Input screen-map is binary.");
122#endif 122#endif
123 } 123 }
124 124
125 if (ioctl(fd, PIO_SCRNMAP, buf)) 125 if (ioctl(fd, PIO_SCRNMAP, buf))
126 perror_msg_and_die("PIO_SCRNMAP ioctl"); 126 bb_perror_msg_and_die("PIO_SCRNMAP ioctl");
127 else 127 else
128 return 0; 128 return 0;
129 } 129 }
130 error_msg("Error parsing symbolic map"); 130 bb_error_msg("Error parsing symbolic map");
131 return(1); 131 return(1);
132} 132}
133 133
@@ -172,7 +172,7 @@ static int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode)
172 if (feof(fp)) 172 if (feof(fp))
173 break; 173 break;
174 else 174 else
175 perror_msg_and_die("uni_screen_map_read_ascii() can't read line"); 175 bb_perror_msg_and_die("uni_screen_map_read_ascii() can't read line");
176 } 176 }
177 177
178 /* get "charset-relative charcode", stripping leading spaces */ 178 /* get "charset-relative charcode", stripping leading spaces */