diff options
Diffstat (limited to 'loadacm.c')
-rw-r--r-- | loadacm.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -46,12 +46,12 @@ int loadacm_main(int argc, char **argv) | |||
46 | 46 | ||
47 | fd = open("/dev/tty", O_RDWR); | 47 | fd = open("/dev/tty", O_RDWR); |
48 | if (fd < 0) { | 48 | if (fd < 0) { |
49 | fprintf(stderr, "Error opening /dev/tty1: %s\n", strerror(errno)); | 49 | errorMsg("Error opening /dev/tty1: %s\n", strerror(errno)); |
50 | return( FALSE); | 50 | return( FALSE); |
51 | } | 51 | } |
52 | 52 | ||
53 | if (screen_map_load(fd, stdin)) { | 53 | if (screen_map_load(fd, stdin)) { |
54 | fprintf(stderr, "Error loading acm: %s\n", strerror(errno)); | 54 | errorMsg("Error loading acm: %s\n", strerror(errno)); |
55 | return( FALSE); | 55 | return( FALSE); |
56 | } | 56 | } |
57 | 57 | ||
@@ -79,8 +79,7 @@ int screen_map_load(int fd, FILE * fp) | |||
79 | if (parse_failed) { | 79 | if (parse_failed) { |
80 | if (-1 == fseek(fp, 0, SEEK_SET)) { | 80 | if (-1 == fseek(fp, 0, SEEK_SET)) { |
81 | if (errno == ESPIPE) | 81 | if (errno == ESPIPE) |
82 | fprintf(stderr, | 82 | errorMsg("16bit screen-map MUST be a regular file.\n"), |
83 | "16bit screen-map MUST be a regular file.\n"), | ||
84 | exit(1); | 83 | exit(1); |
85 | else | 84 | else |
86 | perror("fseek failed reading binary 16bit screen-map"), | 85 | perror("fseek failed reading binary 16bit screen-map"), |
@@ -91,7 +90,7 @@ int screen_map_load(int fd, FILE * fp) | |||
91 | perror("Cannot read [new] map from file"), exit(1); | 90 | perror("Cannot read [new] map from file"), exit(1); |
92 | #if 0 | 91 | #if 0 |
93 | else | 92 | else |
94 | fprintf(stderr, "Input screen-map is binary.\n"); | 93 | errorMsg("Input screen-map is binary.\n"); |
95 | #endif | 94 | #endif |
96 | } | 95 | } |
97 | 96 | ||
@@ -108,8 +107,7 @@ int screen_map_load(int fd, FILE * fp) | |||
108 | /* rewind... */ | 107 | /* rewind... */ |
109 | if (-1 == fseek(fp, 0, SEEK_SET)) { | 108 | if (-1 == fseek(fp, 0, SEEK_SET)) { |
110 | if (errno == ESPIPE) | 109 | if (errno == ESPIPE) |
111 | fprintf(stderr, | 110 | errorMsg("Assuming 8bit screen-map - MUST be a regular file.\n"), |
112 | "Assuming 8bit screen-map - MUST be a regular file.\n"), | ||
113 | exit(1); | 111 | exit(1); |
114 | else | 112 | else |
115 | perror("fseek failed assuming 8bit screen-map"), exit(1); | 113 | perror("fseek failed assuming 8bit screen-map"), exit(1); |
@@ -122,7 +120,7 @@ int screen_map_load(int fd, FILE * fp) | |||
122 | if (-1 == fseek(fp, 0, SEEK_SET)) { | 120 | if (-1 == fseek(fp, 0, SEEK_SET)) { |
123 | if (errno == ESPIPE) | 121 | if (errno == ESPIPE) |
124 | /* should not - it succedeed above */ | 122 | /* should not - it succedeed above */ |
125 | fprintf(stderr, "fseek() returned ESPIPE !\n"), | 123 | errorMsg("fseek() returned ESPIPE !\n"), |
126 | exit(1); | 124 | exit(1); |
127 | else | 125 | else |
128 | perror("fseek for binary 8bit screen-map"), exit(1); | 126 | perror("fseek for binary 8bit screen-map"), exit(1); |
@@ -132,7 +130,7 @@ int screen_map_load(int fd, FILE * fp) | |||
132 | perror("Cannot read [old] map from file"), exit(1); | 130 | perror("Cannot read [old] map from file"), exit(1); |
133 | #if 0 | 131 | #if 0 |
134 | else | 132 | else |
135 | fprintf(stderr, "Input screen-map is binary.\n"); | 133 | errorMsg("Input screen-map is binary.\n"); |
136 | #endif | 134 | #endif |
137 | } | 135 | } |
138 | 136 | ||
@@ -141,7 +139,7 @@ int screen_map_load(int fd, FILE * fp) | |||
141 | else | 139 | else |
142 | return 0; | 140 | return 0; |
143 | } | 141 | } |
144 | fprintf(stderr, "Error parsing symbolic map\n"); | 142 | errorMsg("Error parsing symbolic map\n"); |
145 | return(1); | 143 | return(1); |
146 | } | 144 | } |
147 | 145 | ||