diff options
author | Matt Kraai <kraai@debian.org> | 2001-01-31 19:00:21 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-01-31 19:00:21 +0000 |
commit | dd19c6990496023fe23fefef8f1798740f7d39c6 (patch) | |
tree | 3933adefa4171173db78fa2389146ac89f4edb86 | |
parent | 63ec2732454a0c973305794e185e488106f6b282 (diff) | |
download | busybox-w32-dd19c6990496023fe23fefef8f1798740f7d39c6.tar.gz busybox-w32-dd19c6990496023fe23fefef8f1798740f7d39c6.tar.bz2 busybox-w32-dd19c6990496023fe23fefef8f1798740f7d39c6.zip |
Removed trailing \n from error_msg{,_and_die} messages.
106 files changed, 612 insertions, 610 deletions
diff --git a/applets/busybox.c b/applets/busybox.c index e56d2a4ed..f10467a3b 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -113,7 +113,7 @@ int main(int argc, char **argv) | |||
113 | exit((*(applet->main)) (argc, argv)); | 113 | exit((*(applet->main)) (argc, argv)); |
114 | } | 114 | } |
115 | 115 | ||
116 | error_msg_and_die("applet not found\n"); | 116 | error_msg_and_die("applet not found"); |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
@@ -65,9 +65,9 @@ extern ar_headers_t get_headers(int srcFd) | |||
65 | 65 | ||
66 | /* check ar magic */ | 66 | /* check ar magic */ |
67 | if (full_read(srcFd, ar_magic, 8) != 8) | 67 | if (full_read(srcFd, ar_magic, 8) != 8) |
68 | error_msg_and_die("cannot read magic\n"); | 68 | error_msg_and_die("cannot read magic"); |
69 | if (strncmp(ar_magic,"!<arch>",7) != 0) | 69 | if (strncmp(ar_magic,"!<arch>",7) != 0) |
70 | error_msg_and_die("invalid magic\n"); | 70 | error_msg_and_die("invalid magic"); |
71 | 71 | ||
72 | while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) { | 72 | while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) { |
73 | /* check the end of header markers are valid */ | 73 | /* check the end of header markers are valid */ |
@@ -168,7 +168,7 @@ extern int ar_main(int argc, char **argv) | |||
168 | usage(ar_usage); | 168 | usage(ar_usage); |
169 | 169 | ||
170 | if ( (srcFd = open(argv[optind], O_RDONLY)) < 0) | 170 | if ( (srcFd = open(argv[optind], O_RDONLY)) < 0) |
171 | error_msg_and_die("Cannot read %s\n", argv[optind]); | 171 | error_msg_and_die("Cannot read %s", argv[optind]); |
172 | 172 | ||
173 | optind++; | 173 | optind++; |
174 | head = get_headers(srcFd); | 174 | head = get_headers(srcFd); |
diff --git a/archival/ar.c b/archival/ar.c index 550b2a1c4..5aba30de0 100644 --- a/archival/ar.c +++ b/archival/ar.c | |||
@@ -65,9 +65,9 @@ extern ar_headers_t get_headers(int srcFd) | |||
65 | 65 | ||
66 | /* check ar magic */ | 66 | /* check ar magic */ |
67 | if (full_read(srcFd, ar_magic, 8) != 8) | 67 | if (full_read(srcFd, ar_magic, 8) != 8) |
68 | error_msg_and_die("cannot read magic\n"); | 68 | error_msg_and_die("cannot read magic"); |
69 | if (strncmp(ar_magic,"!<arch>",7) != 0) | 69 | if (strncmp(ar_magic,"!<arch>",7) != 0) |
70 | error_msg_and_die("invalid magic\n"); | 70 | error_msg_and_die("invalid magic"); |
71 | 71 | ||
72 | while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) { | 72 | while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) { |
73 | /* check the end of header markers are valid */ | 73 | /* check the end of header markers are valid */ |
@@ -168,7 +168,7 @@ extern int ar_main(int argc, char **argv) | |||
168 | usage(ar_usage); | 168 | usage(ar_usage); |
169 | 169 | ||
170 | if ( (srcFd = open(argv[optind], O_RDONLY)) < 0) | 170 | if ( (srcFd = open(argv[optind], O_RDONLY)) < 0) |
171 | error_msg_and_die("Cannot read %s\n", argv[optind]); | 171 | error_msg_and_die("Cannot read %s", argv[optind]); |
172 | 172 | ||
173 | optind++; | 173 | optind++; |
174 | head = get_headers(srcFd); | 174 | head = get_headers(srcFd); |
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c index 3a789379b..3345c273f 100644 --- a/archival/dpkg_deb.c +++ b/archival/dpkg_deb.c | |||
@@ -118,7 +118,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
118 | extract_flag = TRUE; | 118 | extract_flag = TRUE; |
119 | strcpy(ar_filename, "data.tar.gz"); | 119 | strcpy(ar_filename, "data.tar.gz"); |
120 | if ( (optind + 2) > argc ) { | 120 | if ( (optind + 2) > argc ) { |
121 | error_msg_and_die("No directory specified\n"); | 121 | error_msg_and_die("No directory specified"); |
122 | } | 122 | } |
123 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); | 123 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); |
124 | strcpy(target_dir, argv[optind+1]); | 124 | strcpy(target_dir, argv[optind+1]); |
@@ -128,7 +128,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
128 | list_flag = TRUE; | 128 | list_flag = TRUE; |
129 | strcpy(ar_filename, "data.tar.gz"); | 129 | strcpy(ar_filename, "data.tar.gz"); |
130 | if ( (optind + 2) > argc ) { | 130 | if ( (optind + 2) > argc ) { |
131 | error_msg_and_die("No directory specified\n"); | 131 | error_msg_and_die("No directory specified"); |
132 | } | 132 | } |
133 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); | 133 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); |
134 | strcpy(target_dir, argv[optind+1]); | 134 | strcpy(target_dir, argv[optind+1]); |
@@ -139,7 +139,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
139 | 139 | ||
140 | *ar_headers = get_headers(srcFd); | 140 | *ar_headers = get_headers(srcFd); |
141 | if (ar_headers->next==NULL) | 141 | if (ar_headers->next==NULL) |
142 | error_msg_and_die("Couldnt find %s in %s\n",ar_filename, argv[optind]); | 142 | error_msg_and_die("Couldnt find %s in %s", ar_filename, argv[optind]); |
143 | 143 | ||
144 | while (ar_headers->next != NULL) { | 144 | while (ar_headers->next != NULL) { |
145 | if (strcmp(ar_headers->name, ar_filename)==0) | 145 | if (strcmp(ar_headers->name, ar_filename)==0) |
@@ -154,7 +154,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
154 | mkdir(target_dir, 0755); | 154 | mkdir(target_dir, 0755); |
155 | } | 155 | } |
156 | if (chdir(target_dir)==-1) { | 156 | if (chdir(target_dir)==-1) { |
157 | error_msg_and_die("Cannot change to dir %s\n",argv[optind+1]); | 157 | error_msg_and_die("Cannot change to dir %s", argv[optind+1]); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list); | 160 | status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list); |
diff --git a/archival/gunzip.c b/archival/gunzip.c index 09571f91c..48a46083b 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c | |||
@@ -297,7 +297,7 @@ int in; /* input file descriptor */ | |||
297 | 297 | ||
298 | method = (int) get_byte(); | 298 | method = (int) get_byte(); |
299 | if (method != DEFLATED) { | 299 | if (method != DEFLATED) { |
300 | error_msg("unknown method %d -- get newer version of gzip\n", method); | 300 | error_msg("unknown method %d -- get newer version of gzip", method); |
301 | exit_code = ERROR; | 301 | exit_code = ERROR; |
302 | return -1; | 302 | return -1; |
303 | } | 303 | } |
@@ -1116,11 +1116,11 @@ int in, out; /* input and output file descriptors */ | |||
1116 | if (res == 3) { | 1116 | if (res == 3) { |
1117 | error_msg(memory_exhausted); | 1117 | error_msg(memory_exhausted); |
1118 | } else if (res != 0) { | 1118 | } else if (res != 0) { |
1119 | error_msg("invalid compressed data--format violated\n"); | 1119 | error_msg("invalid compressed data--format violated"); |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | } else { | 1122 | } else { |
1123 | error_msg("internal error, invalid method\n"); | 1123 | error_msg("internal error, invalid method"); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | /* Get the crc and original length */ | 1126 | /* Get the crc and original length */ |
@@ -1149,15 +1149,15 @@ int in, out; /* input and output file descriptors */ | |||
1149 | 1149 | ||
1150 | /* Validate decompression */ | 1150 | /* Validate decompression */ |
1151 | if (orig_crc != updcrc(outbuf, 0)) { | 1151 | if (orig_crc != updcrc(outbuf, 0)) { |
1152 | error_msg("invalid compressed data--crc error\n"); | 1152 | error_msg("invalid compressed data--crc error"); |
1153 | } | 1153 | } |
1154 | if (orig_len != (ulg) bytes_out) { | 1154 | if (orig_len != (ulg) bytes_out) { |
1155 | error_msg("invalid compressed data--length error\n"); | 1155 | error_msg("invalid compressed data--length error"); |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | /* Check if there are more entries in a pkzip file */ | 1158 | /* Check if there are more entries in a pkzip file */ |
1159 | if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) { | 1159 | if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) { |
1160 | fprintf(stderr, "has more than one entry--rest ignored\n"); | 1160 | error_msg("has more than one entry--rest ignored"); |
1161 | if (exit_code == OK) | 1161 | if (exit_code == OK) |
1162 | exit_code = WARNING; | 1162 | exit_code = WARNING; |
1163 | } | 1163 | } |
@@ -1261,9 +1261,9 @@ int gunzip_main(int argc, char **argv) | |||
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1263 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1264 | error_msg_and_die( "data not read from terminal. Use -f to force it.\n"); | 1264 | error_msg_and_die( "data not read from terminal. Use -f to force it."); |
1265 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) | 1265 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) |
1266 | error_msg_and_die( "data not written to terminal. Use -f to force it.\n"); | 1266 | error_msg_and_die( "data not written to terminal. Use -f to force it."); |
1267 | 1267 | ||
1268 | gunzip_init(); | 1268 | gunzip_init(); |
1269 | 1269 | ||
diff --git a/archival/gzip.c b/archival/gzip.c index 5a74868c1..75f3caa35 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -1382,7 +1382,7 @@ int length; | |||
1382 | (char *) window + start, length) != EQUAL) { | 1382 | (char *) window + start, length) != EQUAL) { |
1383 | fprintf(stderr, | 1383 | fprintf(stderr, |
1384 | " start %d, match %d, length %d\n", start, match, length); | 1384 | " start %d, match %d, length %d\n", start, match, length); |
1385 | error_msg("invalid match\n"); | 1385 | error_msg("invalid match"); |
1386 | } | 1386 | } |
1387 | if (verbose > 1) { | 1387 | if (verbose > 1) { |
1388 | fprintf(stderr, "\\[%d,%d]", start - match, length); | 1388 | fprintf(stderr, "\\[%d,%d]", start - match, length); |
@@ -1822,9 +1822,9 @@ int gzip_main(int argc, char **argv) | |||
1822 | } | 1822 | } |
1823 | 1823 | ||
1824 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1824 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1825 | error_msg_and_die( "data not read from terminal. Use -f to force it.\n"); | 1825 | error_msg_and_die( "data not read from terminal. Use -f to force it."); |
1826 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) | 1826 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) |
1827 | error_msg_and_die( "data not written to terminal. Use -f to force it.\n"); | 1827 | error_msg_and_die( "data not written to terminal. Use -f to force it."); |
1828 | 1828 | ||
1829 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; | 1829 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; |
1830 | if (foreground) { | 1830 | if (foreground) { |
@@ -2894,7 +2894,7 @@ int eof; /* true if this is the last block for a file */ | |||
2894 | #endif | 2894 | #endif |
2895 | /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ | 2895 | /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ |
2896 | if (buf == (char *) 0) | 2896 | if (buf == (char *) 0) |
2897 | error_msg("block vanished\n"); | 2897 | error_msg("block vanished"); |
2898 | 2898 | ||
2899 | copy_block(buf, (unsigned) stored_len, 0); /* without header */ | 2899 | copy_block(buf, (unsigned) stored_len, 0); /* without header */ |
2900 | compressed_len = stored_len << 3; | 2900 | compressed_len = stored_len << 3; |
@@ -3077,7 +3077,7 @@ local void set_file_type() | |||
3077 | bin_freq += dyn_ltree[n++].Freq; | 3077 | bin_freq += dyn_ltree[n++].Freq; |
3078 | *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; | 3078 | *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; |
3079 | if (*file_type == BINARY && translate_eol) { | 3079 | if (*file_type == BINARY && translate_eol) { |
3080 | error_msg("-l used on binary file\n"); | 3080 | error_msg("-l used on binary file"); |
3081 | } | 3081 | } |
3082 | } | 3082 | } |
3083 | 3083 | ||
@@ -3239,7 +3239,7 @@ char *env; /* name of environment variable */ | |||
3239 | 3239 | ||
3240 | /* Copy the program name first */ | 3240 | /* Copy the program name first */ |
3241 | if (oargc-- < 0) | 3241 | if (oargc-- < 0) |
3242 | error_msg("argc<=0\n"); | 3242 | error_msg("argc<=0"); |
3243 | *(nargv++) = *(oargv++); | 3243 | *(nargv++) = *(oargv++); |
3244 | 3244 | ||
3245 | /* Then copy the environment args */ | 3245 | /* Then copy the environment args */ |
diff --git a/archival/tar.c b/archival/tar.c index 308291455..60744e8db 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -165,10 +165,10 @@ extern int tar_unzip_init(int tarFd) | |||
165 | signal(SIGCHLD, child_died); | 165 | signal(SIGCHLD, child_died); |
166 | 166 | ||
167 | if (pipe(unzip_pipe)!=0) | 167 | if (pipe(unzip_pipe)!=0) |
168 | error_msg_and_die("pipe error\n"); | 168 | error_msg_and_die("pipe error"); |
169 | 169 | ||
170 | if ( (child_pid = fork()) == -1) | 170 | if ( (child_pid = fork()) == -1) |
171 | error_msg_and_die("fork failure\n"); | 171 | error_msg_and_die("fork failure"); |
172 | 172 | ||
173 | if (child_pid==0) { | 173 | if (child_pid==0) { |
174 | /* child process */ | 174 | /* child process */ |
@@ -259,7 +259,7 @@ extern int tar_main(int argc, char **argv) | |||
259 | break; | 259 | break; |
260 | case 'f': | 260 | case 'f': |
261 | if (*tarName != '-') | 261 | if (*tarName != '-') |
262 | error_msg_and_die( "Only one 'f' option allowed\n"); | 262 | error_msg_and_die( "Only one 'f' option allowed"); |
263 | tarName = optarg; | 263 | tarName = optarg; |
264 | break; | 264 | break; |
265 | #if defined BB_FEATURE_TAR_EXCLUDE | 265 | #if defined BB_FEATURE_TAR_EXCLUDE |
@@ -294,11 +294,11 @@ extern int tar_main(int argc, char **argv) | |||
294 | */ | 294 | */ |
295 | if (createFlag == TRUE) { | 295 | if (createFlag == TRUE) { |
296 | #ifndef BB_FEATURE_TAR_CREATE | 296 | #ifndef BB_FEATURE_TAR_CREATE |
297 | error_msg_and_die( "This version of tar was not compiled with tar creation support.\n"); | 297 | error_msg_and_die( "This version of tar was not compiled with tar creation support."); |
298 | #else | 298 | #else |
299 | #ifdef BB_FEATURE_TAR_GZIP | 299 | #ifdef BB_FEATURE_TAR_GZIP |
300 | if (unzipFlag==TRUE) | 300 | if (unzipFlag==TRUE) |
301 | error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip\n"); | 301 | error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip"); |
302 | #endif | 302 | #endif |
303 | status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList); | 303 | status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList); |
304 | #endif | 304 | #endif |
@@ -330,7 +330,7 @@ extern int tar_main(int argc, char **argv) | |||
330 | return EXIT_FAILURE; | 330 | return EXIT_FAILURE; |
331 | 331 | ||
332 | flagError: | 332 | flagError: |
333 | error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n"); | 333 | error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified"); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void | 336 | static void |
@@ -383,7 +383,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
383 | } | 383 | } |
384 | if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) { | 384 | if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) { |
385 | /* Tarball seems to have a problem */ | 385 | /* Tarball seems to have a problem */ |
386 | error_msg("Unexpected EOF in archive\n"); | 386 | error_msg("Unexpected EOF in archive"); |
387 | return( FALSE); | 387 | return( FALSE); |
388 | } | 388 | } |
389 | if ( readSize < writeSize ) | 389 | if ( readSize < writeSize ) |
@@ -476,7 +476,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
476 | /* Do not change permissions or date on symlink, | 476 | /* Do not change permissions or date on symlink, |
477 | * since it changes the pointed to file instead. duh. */ | 477 | * since it changes the pointed to file instead. duh. */ |
478 | #else | 478 | #else |
479 | error_msg("%s: Cannot create symlink to '%s': %s\n", | 479 | error_msg("%s: Cannot create symlink to '%s': %s", |
480 | header->name, header->linkname, | 480 | header->name, header->linkname, |
481 | "symlinks not supported"); | 481 | "symlinks not supported"); |
482 | #endif | 482 | #endif |
@@ -543,7 +543,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header) | |||
543 | ++*(header->name); | 543 | ++*(header->name); |
544 | 544 | ||
545 | if (alreadyWarned == FALSE) { | 545 | if (alreadyWarned == FALSE) { |
546 | error_msg("Removing leading '/' from member names\n"); | 546 | error_msg("Removing leading '/' from member names"); |
547 | alreadyWarned = TRUE; | 547 | alreadyWarned = TRUE; |
548 | } | 548 | } |
549 | } | 549 | } |
@@ -644,7 +644,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
644 | goto endgame; | 644 | goto endgame; |
645 | } else { | 645 | } else { |
646 | errorFlag=TRUE; | 646 | errorFlag=TRUE; |
647 | error_msg("Bad tar header, skipping\n"); | 647 | error_msg("Bad tar header, skipping"); |
648 | continue; | 648 | continue; |
649 | } | 649 | } |
650 | } | 650 | } |
@@ -791,7 +791,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
791 | break; | 791 | break; |
792 | #endif | 792 | #endif |
793 | default: | 793 | default: |
794 | error_msg("Unknown file type '%c' in tar file\n", header.type); | 794 | error_msg("Unknown file type '%c' in tar file", header.type); |
795 | close( tarFd); | 795 | close( tarFd); |
796 | return( FALSE); | 796 | return( FALSE); |
797 | } | 797 | } |
@@ -803,7 +803,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
803 | return ( FALSE); | 803 | return ( FALSE); |
804 | } | 804 | } |
805 | else if (errorFlag==TRUE) { | 805 | else if (errorFlag==TRUE) { |
806 | error_msg( "Error exit delayed from previous errors\n"); | 806 | error_msg( "Error exit delayed from previous errors"); |
807 | return( FALSE); | 807 | return( FALSE); |
808 | } else | 808 | } else |
809 | return( status); | 809 | return( status); |
@@ -813,7 +813,7 @@ endgame: | |||
813 | close( tarFd); | 813 | close( tarFd); |
814 | if ( *(header.name) == '\0' ) { | 814 | if ( *(header.name) == '\0' ) { |
815 | if (errorFlag==TRUE) | 815 | if (errorFlag==TRUE) |
816 | error_msg( "Error exit delayed from previous errors\n"); | 816 | error_msg( "Error exit delayed from previous errors"); |
817 | else | 817 | else |
818 | return( TRUE); | 818 | return( TRUE); |
819 | } | 819 | } |
@@ -1002,7 +1002,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name, | |||
1002 | header.typeflag = REGTYPE; | 1002 | header.typeflag = REGTYPE; |
1003 | putOctal(header.size, sizeof(header.size), statbuf->st_size); | 1003 | putOctal(header.size, sizeof(header.size), statbuf->st_size); |
1004 | } else { | 1004 | } else { |
1005 | error_msg("%s: Unknown file type\n", real_name); | 1005 | error_msg("%s: Unknown file type", real_name); |
1006 | return ( FALSE); | 1006 | return ( FALSE); |
1007 | } | 1007 | } |
1008 | 1008 | ||
@@ -1061,7 +1061,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1061 | 1061 | ||
1062 | /* It is against the rules to archive a socket */ | 1062 | /* It is against the rules to archive a socket */ |
1063 | if (S_ISSOCK(statbuf->st_mode)) { | 1063 | if (S_ISSOCK(statbuf->st_mode)) { |
1064 | error_msg("%s: socket ignored\n", fileName); | 1064 | error_msg("%s: socket ignored", fileName); |
1065 | return( TRUE); | 1065 | return( TRUE); |
1066 | } | 1066 | } |
1067 | 1067 | ||
@@ -1070,7 +1070,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1070 | * the new tarball */ | 1070 | * the new tarball */ |
1071 | if (tbInfo->statBuf.st_dev == statbuf->st_dev && | 1071 | if (tbInfo->statBuf.st_dev == statbuf->st_dev && |
1072 | tbInfo->statBuf.st_ino == statbuf->st_ino) { | 1072 | tbInfo->statBuf.st_ino == statbuf->st_ino) { |
1073 | error_msg("%s: file is the archive; skipping\n", fileName); | 1073 | error_msg("%s: file is the archive; skipping", fileName); |
1074 | return( TRUE); | 1074 | return( TRUE); |
1075 | } | 1075 | } |
1076 | 1076 | ||
@@ -1078,7 +1078,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1078 | while (header_name[0] == '/') { | 1078 | while (header_name[0] == '/') { |
1079 | static int alreadyWarned=FALSE; | 1079 | static int alreadyWarned=FALSE; |
1080 | if (alreadyWarned==FALSE) { | 1080 | if (alreadyWarned==FALSE) { |
1081 | error_msg("Removing leading '/' from member names\n"); | 1081 | error_msg("Removing leading '/' from member names"); |
1082 | alreadyWarned=TRUE; | 1082 | alreadyWarned=TRUE; |
1083 | } | 1083 | } |
1084 | header_name++; | 1084 | header_name++; |
@@ -1111,7 +1111,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1111 | 1111 | ||
1112 | /* open the file we want to archive, and make sure all is well */ | 1112 | /* open the file we want to archive, and make sure all is well */ |
1113 | if ((inputFileFd = open(fileName, O_RDONLY)) < 0) { | 1113 | if ((inputFileFd = open(fileName, O_RDONLY)) < 0) { |
1114 | error_msg("%s: Cannot open: %s\n", fileName, strerror(errno)); | 1114 | error_msg("%s: Cannot open: %s", fileName, strerror(errno)); |
1115 | return( FALSE); | 1115 | return( FALSE); |
1116 | } | 1116 | } |
1117 | 1117 | ||
@@ -1150,7 +1150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
1150 | 1150 | ||
1151 | /* Make sure there is at least one file to tar up. */ | 1151 | /* Make sure there is at least one file to tar up. */ |
1152 | if (*argv == NULL) | 1152 | if (*argv == NULL) |
1153 | error_msg_and_die("Cowardly refusing to create an empty archive\n"); | 1153 | error_msg_and_die("Cowardly refusing to create an empty archive"); |
1154 | 1154 | ||
1155 | /* Open the tar file for writing. */ | 1155 | /* Open the tar file for writing. */ |
1156 | if (!strcmp(tarName, "-")) | 1156 | if (!strcmp(tarName, "-")) |
@@ -1193,7 +1193,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
1193 | /* Hang up the tools, close up shop, head home */ | 1193 | /* Hang up the tools, close up shop, head home */ |
1194 | close(tarFd); | 1194 | close(tarFd); |
1195 | if (errorFlag == TRUE) { | 1195 | if (errorFlag == TRUE) { |
1196 | error_msg("Error exit delayed from previous errors\n"); | 1196 | error_msg("Error exit delayed from previous errors"); |
1197 | freeHardLinkInfo(&tbInfo.hlInfoHead); | 1197 | freeHardLinkInfo(&tbInfo.hlInfoHead); |
1198 | return(FALSE); | 1198 | return(FALSE); |
1199 | } | 1199 | } |
@@ -113,7 +113,7 @@ int main(int argc, char **argv) | |||
113 | exit((*(applet->main)) (argc, argv)); | 113 | exit((*(applet->main)) (argc, argv)); |
114 | } | 114 | } |
115 | 115 | ||
116 | error_msg_and_die("applet not found\n"); | 116 | error_msg_and_die("applet not found"); |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c index 178138a3b..81db10151 100644 --- a/chmod_chown_chgrp.c +++ b/chmod_chown_chgrp.c | |||
@@ -65,7 +65,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | |||
65 | case CHMOD_APP: | 65 | case CHMOD_APP: |
66 | /* Parse the specified modes */ | 66 | /* Parse the specified modes */ |
67 | if (parse_mode(theMode, &(statbuf->st_mode)) == FALSE) { | 67 | if (parse_mode(theMode, &(statbuf->st_mode)) == FALSE) { |
68 | error_msg_and_die( "unknown mode: %s\n", theMode); | 68 | error_msg_and_die( "unknown mode: %s", theMode); |
69 | } | 69 | } |
70 | if (chmod(fileName, statbuf->st_mode) == 0) | 70 | if (chmod(fileName, statbuf->st_mode) == 0) |
71 | return (TRUE); | 71 | return (TRUE); |
@@ -150,7 +150,7 @@ int chmod_chown_chgrp_main(int argc, char **argv) | |||
150 | if (*argv == p) | 150 | if (*argv == p) |
151 | uid = my_getpwnam(*argv); | 151 | uid = my_getpwnam(*argv); |
152 | if (uid == -1) { | 152 | if (uid == -1) { |
153 | error_msg_and_die( "unknown user name: %s\n", *argv); | 153 | error_msg_and_die( "unknown user name: %s", *argv); |
154 | } | 154 | } |
155 | } | 155 | } |
156 | } | 156 | } |
@@ -167,7 +167,7 @@ int chmod_chown_chgrp_main(int argc, char **argv) | |||
167 | return EXIT_SUCCESS; | 167 | return EXIT_SUCCESS; |
168 | 168 | ||
169 | bad_group: | 169 | bad_group: |
170 | error_msg_and_die( "unknown group name: %s\n", groupName); | 170 | error_msg_and_die( "unknown group name: %s", groupName); |
171 | } | 171 | } |
172 | 172 | ||
173 | /* | 173 | /* |
@@ -318,7 +318,7 @@ static void cmdedit_setwidth(int w, int redraw_flg) | |||
318 | input_backward(); | 318 | input_backward(); |
319 | } | 319 | } |
320 | } else { | 320 | } else { |
321 | error_msg("\n*** Error: minimum screen width is %d\n", cmdedit_termw); | 321 | error_msg("\n*** Error: minimum screen width is %d", cmdedit_termw); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index fad7a2bb2..b51fbaef4 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c | |||
@@ -31,9 +31,9 @@ int deallocvt_main(int argc, char *argv[]) | |||
31 | for (i = 1; i < argc; i++) { | 31 | for (i = 1; i < argc; i++) { |
32 | num = atoi(argv[i]); | 32 | num = atoi(argv[i]); |
33 | if (num == 0) | 33 | if (num == 0) |
34 | error_msg("0: illegal VT number\n"); | 34 | error_msg("0: illegal VT number"); |
35 | else if (num == 1) | 35 | else if (num == 1) |
36 | error_msg("VT 1 cannot be deallocated\n"); | 36 | error_msg("VT 1 cannot be deallocated"); |
37 | else if (ioctl(fd, VT_DISALLOCATE, num)) | 37 | else if (ioctl(fd, VT_DISALLOCATE, num)) |
38 | perror_msg_and_die("VT_DISALLOCATE"); | 38 | perror_msg_and_die("VT_DISALLOCATE"); |
39 | } | 39 | } |
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index b2067b30c..4ab711e55 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c | |||
@@ -81,7 +81,7 @@ int dumpkmap_main(int argc, char **argv) | |||
81 | ke.kb_table = i; | 81 | ke.kb_table = i; |
82 | if (ioctl(fd, KDGKBENT, &ke) < 0) { | 82 | if (ioctl(fd, KDGKBENT, &ke) < 0) { |
83 | 83 | ||
84 | error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); | 84 | error_msg("ioctl returned: %s, %s, %s, %xqq", strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); |
85 | } | 85 | } |
86 | else { | 86 | else { |
87 | write(1,(void*)&ke.kb_value,2); | 87 | write(1,(void*)&ke.kb_value,2); |
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c index 040062cf8..345a2773c 100644 --- a/console-tools/loadacm.c +++ b/console-tools/loadacm.c | |||
@@ -70,7 +70,7 @@ 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.\n"); | 73 | 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 | perror_msg_and_die("fseek failed reading binary 16bit screen-map"); |
76 | } | 76 | } |
@@ -79,7 +79,7 @@ int screen_map_load(int fd, FILE * fp) | |||
79 | perror_msg_and_die("Cannot read [new] map from file"); | 79 | 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.\n"); | 82 | error_msg("Input screen-map is binary."); |
83 | #endif | 83 | #endif |
84 | } | 84 | } |
85 | 85 | ||
@@ -96,7 +96,7 @@ 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.\n"), | 99 | 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 | perror_msg_and_die("fseek failed assuming 8bit screen-map"); |
@@ -109,7 +109,7 @@ 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 !\n"); | 112 | error_msg_and_die("fseek() returned ESPIPE !"); |
113 | else | 113 | else |
114 | perror_msg_and_die("fseek for binary 8bit screen-map"); | 114 | perror_msg_and_die("fseek for binary 8bit screen-map"); |
115 | } | 115 | } |
@@ -118,7 +118,7 @@ int screen_map_load(int fd, FILE * fp) | |||
118 | perror_msg_and_die("Cannot read [old] map from file"); | 118 | 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.\n"); | 121 | error_msg("Input screen-map is binary."); |
122 | #endif | 122 | #endif |
123 | } | 123 | } |
124 | 124 | ||
@@ -127,7 +127,7 @@ int screen_map_load(int fd, FILE * fp) | |||
127 | else | 127 | else |
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | error_msg("Error parsing symbolic map\n"); | 130 | error_msg("Error parsing symbolic map"); |
131 | return(1); | 131 | return(1); |
132 | } | 132 | } |
133 | 133 | ||
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 08e07618e..ec3e50560 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c | |||
@@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize) | |||
62 | memset(buf, 0, sizeof(buf)); | 62 | memset(buf, 0, sizeof(buf)); |
63 | 63 | ||
64 | if (unit < 1 || unit > 32) | 64 | if (unit < 1 || unit > 32) |
65 | error_msg_and_die("Bad character size %d\n", unit); | 65 | error_msg_and_die("Bad character size %d", unit); |
66 | 66 | ||
67 | for (i = 0; i < fontsize; i++) | 67 | for (i = 0; i < fontsize; i++) |
68 | memcpy(buf + (32 * i), inbuf + (unit * i), unit); | 68 | memcpy(buf + (32 * i), inbuf + (unit * i), unit); |
@@ -119,8 +119,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize) | |||
119 | if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { | 119 | if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { |
120 | #ifdef ENOIOCTLCMD | 120 | #ifdef ENOIOCTLCMD |
121 | if (errno == ENOIOCTLCMD) { | 121 | if (errno == ENOIOCTLCMD) { |
122 | error_msg("It seems this kernel is older than 1.1.92\n"); | 122 | error_msg("It seems this kernel is older than 1.1.92"); |
123 | error_msg_and_die("No Unicode mapping table loaded.\n"); | 123 | error_msg_and_die("No Unicode mapping table loaded."); |
124 | } else | 124 | } else |
125 | #endif | 125 | #endif |
126 | perror_msg_and_die("PIO_UNIMAPCLR"); | 126 | perror_msg_and_die("PIO_UNIMAPCLR"); |
@@ -174,11 +174,11 @@ static void loadnewfont(int fd) | |||
174 | goto no_psf; | 174 | goto no_psf; |
175 | 175 | ||
176 | if (psfhdr.mode > PSF_MAXMODE) | 176 | if (psfhdr.mode > PSF_MAXMODE) |
177 | error_msg_and_die("Unsupported psf file mode\n"); | 177 | error_msg_and_die("Unsupported psf file mode"); |
178 | fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); | 178 | fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); |
179 | #if !defined( PIO_FONTX ) || defined( __sparc__ ) | 179 | #if !defined( PIO_FONTX ) || defined( __sparc__ ) |
180 | if (fontsize != 256) | 180 | if (fontsize != 256) |
181 | error_msg_and_die("Only fontsize 256 supported\n"); | 181 | error_msg_and_die("Only fontsize 256 supported"); |
182 | #endif | 182 | #endif |
183 | hastable = (psfhdr.mode & PSF_MODEHASTAB); | 183 | hastable = (psfhdr.mode & PSF_MODEHASTAB); |
184 | unit = psfhdr.charsize; | 184 | unit = psfhdr.charsize; |
@@ -186,7 +186,7 @@ static void loadnewfont(int fd) | |||
186 | 186 | ||
187 | head = head0 + fontsize * unit; | 187 | head = head0 + fontsize * unit; |
188 | if (head > inputlth || (!hastable && head != inputlth)) | 188 | if (head > inputlth || (!hastable && head != inputlth)) |
189 | error_msg_and_die("Input file: bad length\n"); | 189 | error_msg_and_die("Input file: bad length"); |
190 | do_loadfont(fd, inbuf + head0, unit, fontsize); | 190 | do_loadfont(fd, inbuf + head0, unit, fontsize); |
191 | if (hastable) | 191 | if (hastable) |
192 | do_loadtable(fd, inbuf + head, inputlth - head, fontsize); | 192 | do_loadtable(fd, inbuf + head, inputlth - head, fontsize); |
@@ -201,7 +201,7 @@ static void loadnewfont(int fd) | |||
201 | } else { | 201 | } else { |
202 | /* bare font */ | 202 | /* bare font */ |
203 | if (inputlth & 0377) | 203 | if (inputlth & 0377) |
204 | error_msg_and_die("Bad input file size\n"); | 204 | error_msg_and_die("Bad input file size"); |
205 | offset = 0; | 205 | offset = 0; |
206 | unit = inputlth / 256; | 206 | unit = inputlth / 256; |
207 | } | 207 | } |
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index 75b40da9a..a98601aec 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c | |||
@@ -59,7 +59,7 @@ int loadkmap_main(int argc, char **argv) | |||
59 | 59 | ||
60 | read(0, buff, 7); | 60 | read(0, buff, 7); |
61 | if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) | 61 | if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) |
62 | error_msg_and_die("This is not a valid binary keymap.\n"); | 62 | error_msg_and_die("This is not a valid binary keymap."); |
63 | 63 | ||
64 | if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) | 64 | if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) |
65 | perror_msg_and_die("Error reading keymap flags"); | 65 | perror_msg_and_die("Error reading keymap flags"); |
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c index be9b1b797..3e511ad00 100644 --- a/console-tools/setkeycodes.c +++ b/console-tools/setkeycodes.c | |||
@@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv) | |||
52 | a.keycode = atoi(argv[2]); | 52 | a.keycode = atoi(argv[2]); |
53 | a.scancode = sc = strtol(argv[1], &ep, 16); | 53 | a.scancode = sc = strtol(argv[1], &ep, 16); |
54 | if (*ep) { | 54 | if (*ep) { |
55 | error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]); | 55 | error_msg_and_die("error reading SCANCODE: '%s'", argv[1]); |
56 | } | 56 | } |
57 | if (a.scancode > 127) { | 57 | if (a.scancode > 127) { |
58 | a.scancode -= 0xe000; | 58 | a.scancode -= 0xe000; |
59 | a.scancode += 128; | 59 | a.scancode += 128; |
60 | } | 60 | } |
61 | if (a.scancode > 255 || a.keycode > 127) { | 61 | if (a.scancode > 255 || a.keycode > 127) { |
62 | error_msg_and_die("SCANCODE or KEYCODE outside bounds\n"); | 62 | error_msg_and_die("SCANCODE or KEYCODE outside bounds"); |
63 | } | 63 | } |
64 | if (ioctl(fd,KDSETKEYCODE,&a)) { | 64 | if (ioctl(fd,KDSETKEYCODE,&a)) { |
65 | perror("KDSETKEYCODE"); | 65 | perror("KDSETKEYCODE"); |
66 | error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode); | 66 | error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode); |
67 | } | 67 | } |
68 | argc -= 2; | 68 | argc -= 2; |
69 | argv += 2; | 69 | argv += 2; |
diff --git a/coreutils/cut.c b/coreutils/cut.c index ed68657df..7e9a72e3f 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -54,12 +54,12 @@ static void decompose_list(const char *list) | |||
54 | /* the list must contain only digits and no more than one minus sign */ | 54 | /* the list must contain only digits and no more than one minus sign */ |
55 | for (ptr = (char *)list; *ptr; ptr++) { | 55 | for (ptr = (char *)list; *ptr; ptr++) { |
56 | if (!isdigit(*ptr) && *ptr != '-') { | 56 | if (!isdigit(*ptr) && *ptr != '-') { |
57 | error_msg_and_die("invalid byte or field list\n"); | 57 | error_msg_and_die("invalid byte or field list"); |
58 | } | 58 | } |
59 | if (*ptr == '-') { | 59 | if (*ptr == '-') { |
60 | nminus++; | 60 | nminus++; |
61 | if (nminus > 1) { | 61 | if (nminus > 1) { |
62 | error_msg_and_die("invalid byte or field list\n"); | 62 | error_msg_and_die("invalid byte or field list"); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | } | 65 | } |
@@ -68,7 +68,7 @@ static void decompose_list(const char *list) | |||
68 | if (nminus == 0) { | 68 | if (nminus == 0) { |
69 | startpos = strtol(list, &ptr, 10); | 69 | startpos = strtol(list, &ptr, 10); |
70 | if (startpos == 0) { | 70 | if (startpos == 0) { |
71 | error_msg_and_die("missing list of fields\n"); | 71 | error_msg_and_die("missing list of fields"); |
72 | } | 72 | } |
73 | endpos = startpos; | 73 | endpos = startpos; |
74 | } | 74 | } |
@@ -188,14 +188,14 @@ extern int cut_main(int argc, char **argv) | |||
188 | case 'f': | 188 | case 'f': |
189 | /* make sure they didn't ask for two types of lists */ | 189 | /* make sure they didn't ask for two types of lists */ |
190 | if (part != 0) { | 190 | if (part != 0) { |
191 | error_msg_and_die("only one type of list may be specified\n"); | 191 | error_msg_and_die("only one type of list may be specified"); |
192 | } | 192 | } |
193 | part = (char)opt; | 193 | part = (char)opt; |
194 | decompose_list(optarg); | 194 | decompose_list(optarg); |
195 | break; | 195 | break; |
196 | case 'd': | 196 | case 'd': |
197 | if (strlen(optarg) > 1) { | 197 | if (strlen(optarg) > 1) { |
198 | error_msg_and_die("the delimiter must be a single character\n"); | 198 | error_msg_and_die("the delimiter must be a single character"); |
199 | } | 199 | } |
200 | delim = optarg[0]; | 200 | delim = optarg[0]; |
201 | break; | 201 | break; |
@@ -209,17 +209,17 @@ extern int cut_main(int argc, char **argv) | |||
209 | } | 209 | } |
210 | 210 | ||
211 | if (part == 0) { | 211 | if (part == 0) { |
212 | error_msg_and_die("you must specify a list of bytes, characters, or fields\n"); | 212 | error_msg_and_die("you must specify a list of bytes, characters, or fields"); |
213 | } | 213 | } |
214 | 214 | ||
215 | if (supress_non_delimited_lines && part != 'f') { | 215 | if (supress_non_delimited_lines && part != 'f') { |
216 | error_msg_and_die("suppressing non-delimited lines makes sense" | 216 | error_msg_and_die("suppressing non-delimited lines makes sense" |
217 | " only when operating on fields\n"); | 217 | " only when operating on fields"); |
218 | 218 | ||
219 | } | 219 | } |
220 | 220 | ||
221 | if (delim != '\t' && part != 'f') { | 221 | if (delim != '\t' && part != 'f') { |
222 | error_msg_and_die("a delimiter may be specified only when operating on fields\n"); | 222 | error_msg_and_die("a delimiter may be specified only when operating on fields"); |
223 | } | 223 | } |
224 | 224 | ||
225 | /* argv[(optind)..(argc-1)] should be names of file to process. If no | 225 | /* argv[(optind)..(argc-1)] should be names of file to process. If no |
diff --git a/coreutils/dd.c b/coreutils/dd.c index dac9ccdf3..582310681 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -76,7 +76,7 @@ int dd_main(int argc, char **argv) | |||
76 | sync = TRUE; | 76 | sync = TRUE; |
77 | buf += 4; | 77 | buf += 4; |
78 | } else { | 78 | } else { |
79 | error_msg_and_die("invalid conversion `%s'\n", argv[i]+5); | 79 | error_msg_and_die("invalid conversion `%s'", argv[i]+5); |
80 | } | 80 | } |
81 | if (buf[0] == '\0') | 81 | if (buf[0] == '\0') |
82 | break; | 82 | break; |
diff --git a/coreutils/df.c b/coreutils/df.c index 7a24fedd0..55919793c 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -118,7 +118,7 @@ extern int df_main(int argc, char **argv) | |||
118 | for(i = optind; i < argc; i++) | 118 | for(i = optind; i < argc; i++) |
119 | { | 119 | { |
120 | if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) { | 120 | if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) { |
121 | error_msg("%s: can't find mount point.\n", argv[i]); | 121 | error_msg("%s: can't find mount point.", argv[i]); |
122 | status = EXIT_FAILURE; | 122 | status = EXIT_FAILURE; |
123 | } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir)) | 123 | } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir)) |
124 | status = EXIT_FAILURE; | 124 | status = EXIT_FAILURE; |
diff --git a/coreutils/expr.c b/coreutils/expr.c index 71bd22417..8ef5293c1 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
@@ -76,14 +76,14 @@ int expr_main (int argc, char **argv) | |||
76 | VALUE *v; | 76 | VALUE *v; |
77 | 77 | ||
78 | if (argc == 1) { | 78 | if (argc == 1) { |
79 | error_msg_and_die("too few arguments\n"); | 79 | error_msg_and_die("too few arguments"); |
80 | } | 80 | } |
81 | 81 | ||
82 | args = argv + 1; | 82 | args = argv + 1; |
83 | 83 | ||
84 | v = eval (); | 84 | v = eval (); |
85 | if (*args) | 85 | if (*args) |
86 | error_msg_and_die ("syntax error\n"); | 86 | error_msg_and_die ("syntax error"); |
87 | 87 | ||
88 | if (v->type == integer) | 88 | if (v->type == integer) |
89 | printf ("%d\n", v->u.i); | 89 | printf ("%d\n", v->u.i); |
@@ -218,7 +218,7 @@ static \ | |||
218 | int name (l, r) VALUE *l; VALUE *r; \ | 218 | int name (l, r) VALUE *l; VALUE *r; \ |
219 | { \ | 219 | { \ |
220 | if (!toarith (l) || !toarith (r)) \ | 220 | if (!toarith (l) || !toarith (r)) \ |
221 | error_msg_and_die ("non-numeric argument\n"); \ | 221 | error_msg_and_die ("non-numeric argument"); \ |
222 | return l->u.i op r->u.i; \ | 222 | return l->u.i op r->u.i; \ |
223 | } | 223 | } |
224 | 224 | ||
@@ -226,9 +226,9 @@ int name (l, r) VALUE *l; VALUE *r; \ | |||
226 | int name (l, r) VALUE *l; VALUE *r; \ | 226 | int name (l, r) VALUE *l; VALUE *r; \ |
227 | { \ | 227 | { \ |
228 | if (!toarith (l) || !toarith (r)) \ | 228 | if (!toarith (l) || !toarith (r)) \ |
229 | error_msg_and_die ( "non-numeric argument\n"); \ | 229 | error_msg_and_die ( "non-numeric argument"); \ |
230 | if (r->u.i == 0) \ | 230 | if (r->u.i == 0) \ |
231 | error_msg_and_die ( "division by zero\n"); \ | 231 | error_msg_and_die ( "division by zero"); \ |
232 | return l->u.i op r->u.i; \ | 232 | return l->u.i op r->u.i; \ |
233 | } | 233 | } |
234 | 234 | ||
@@ -272,7 +272,7 @@ of a basic regular expression is not portable; it is being ignored", | |||
272 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; | 272 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; |
273 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); | 273 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); |
274 | if (errmsg) { | 274 | if (errmsg) { |
275 | error_msg_and_die("%s\n", errmsg); | 275 | error_msg_and_die("%s", errmsg); |
276 | } | 276 | } |
277 | 277 | ||
278 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); | 278 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); |
@@ -303,19 +303,19 @@ static VALUE *eval7 (void) | |||
303 | VALUE *v; | 303 | VALUE *v; |
304 | 304 | ||
305 | if (!*args) | 305 | if (!*args) |
306 | error_msg_and_die ( "syntax error\n"); | 306 | error_msg_and_die ( "syntax error"); |
307 | 307 | ||
308 | if (nextarg ("(")) { | 308 | if (nextarg ("(")) { |
309 | args++; | 309 | args++; |
310 | v = eval (); | 310 | v = eval (); |
311 | if (!nextarg (")")) | 311 | if (!nextarg (")")) |
312 | error_msg_and_die ( "syntax error\n"); | 312 | error_msg_and_die ( "syntax error"); |
313 | args++; | 313 | args++; |
314 | return v; | 314 | return v; |
315 | } | 315 | } |
316 | 316 | ||
317 | if (nextarg (")")) | 317 | if (nextarg (")")) |
318 | error_msg_and_die ( "syntax error\n"); | 318 | error_msg_and_die ( "syntax error"); |
319 | 319 | ||
320 | return str_value (*args++); | 320 | return str_value (*args++); |
321 | } | 321 | } |
@@ -329,7 +329,7 @@ static VALUE *eval6 (void) | |||
329 | if (nextarg ("quote")) { | 329 | if (nextarg ("quote")) { |
330 | args++; | 330 | args++; |
331 | if (!*args) | 331 | if (!*args) |
332 | error_msg_and_die ( "syntax error\n"); | 332 | error_msg_and_die ( "syntax error"); |
333 | return str_value (*args++); | 333 | return str_value (*args++); |
334 | } | 334 | } |
335 | else if (nextarg ("length")) { | 335 | else if (nextarg ("length")) { |
diff --git a/coreutils/id.c b/coreutils/id.c index e91ac7585..650e3db20 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
@@ -77,7 +77,7 @@ extern int id_main(int argc, char **argv) | |||
77 | pwnam=my_getpwnam(user); | 77 | pwnam=my_getpwnam(user); |
78 | grnam=my_getgrnam(group); | 78 | grnam=my_getgrnam(group); |
79 | if (gid == -1 || pwnam==-1 || grnam==-1) { | 79 | if (gid == -1 || pwnam==-1 || grnam==-1) { |
80 | error_msg_and_die("%s: No such user\n", user); | 80 | error_msg_and_die("%s: No such user", user); |
81 | } | 81 | } |
82 | 82 | ||
83 | if (no_group) { | 83 | if (no_group) { |
diff --git a/coreutils/logname.c b/coreutils/logname.c index edec016e6..d9056c69d 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c | |||
@@ -37,5 +37,5 @@ extern int logname_main(int argc, char **argv) | |||
37 | puts(user); | 37 | puts(user); |
38 | return EXIT_SUCCESS; | 38 | return EXIT_SUCCESS; |
39 | } | 39 | } |
40 | error_msg_and_die("no login name\n"); | 40 | error_msg_and_die("no login name"); |
41 | } | 41 | } |
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c index ad4078040..97a940059 100644 --- a/coreutils/md5sum.c +++ b/coreutils/md5sum.c | |||
@@ -719,7 +719,7 @@ static int md5_check(const char *checkfile_name) | |||
719 | if (split_3(line, line_length, &md5num, &binary, &filename) | 719 | if (split_3(line, line_length, &md5num, &binary, &filename) |
720 | || !hex_digits(md5num)) { | 720 | || !hex_digits(md5num)) { |
721 | if (warn) { | 721 | if (warn) { |
722 | error_msg("%s: %lu: improperly formatted MD5 checksum line\n", | 722 | error_msg("%s: %lu: improperly formatted MD5 checksum line", |
723 | checkfile_name, (unsigned long) line_number); | 723 | checkfile_name, (unsigned long) line_number); |
724 | } | 724 | } |
725 | } else { | 725 | } else { |
@@ -764,7 +764,7 @@ static int md5_check(const char *checkfile_name) | |||
764 | while (!feof(checkfile_stream) && !ferror(checkfile_stream)); | 764 | while (!feof(checkfile_stream) && !ferror(checkfile_stream)); |
765 | 765 | ||
766 | if (ferror(checkfile_stream)) { | 766 | if (ferror(checkfile_stream)) { |
767 | error_msg("%s: read error\n", checkfile_name); /* */ | 767 | error_msg("%s: read error", checkfile_name); |
768 | return FALSE; | 768 | return FALSE; |
769 | } | 769 | } |
770 | 770 | ||
@@ -775,7 +775,7 @@ static int md5_check(const char *checkfile_name) | |||
775 | 775 | ||
776 | if (n_properly_formated_lines == 0) { | 776 | if (n_properly_formated_lines == 0) { |
777 | /* Warn if no tests are found. */ | 777 | /* Warn if no tests are found. */ |
778 | error_msg("%s: no properly formatted MD5 checksum lines found\n", | 778 | error_msg("%s: no properly formatted MD5 checksum lines found", |
779 | checkfile_name); | 779 | checkfile_name); |
780 | return FALSE; | 780 | return FALSE; |
781 | } else { | 781 | } else { |
@@ -784,13 +784,13 @@ static int md5_check(const char *checkfile_name) | |||
784 | - n_open_or_read_failures); | 784 | - n_open_or_read_failures); |
785 | 785 | ||
786 | if (n_open_or_read_failures > 0) { | 786 | if (n_open_or_read_failures > 0) { |
787 | error_msg("WARNING: %d of %d listed files could not be read\n", | 787 | error_msg("WARNING: %d of %d listed files could not be read", |
788 | n_open_or_read_failures, n_properly_formated_lines); | 788 | n_open_or_read_failures, n_properly_formated_lines); |
789 | return FALSE; | 789 | return FALSE; |
790 | } | 790 | } |
791 | 791 | ||
792 | if (n_mismatched_checksums > 0) { | 792 | if (n_mismatched_checksums > 0) { |
793 | error_msg("WARNING: %d of %d computed checksums did NOT match\n", | 793 | error_msg("WARNING: %d of %d computed checksums did NOT match", |
794 | n_mismatched_checksums, n_computed_checkums); | 794 | n_mismatched_checksums, n_computed_checkums); |
795 | return FALSE; | 795 | return FALSE; |
796 | } | 796 | } |
@@ -855,26 +855,26 @@ int md5sum_main(int argc, | |||
855 | } | 855 | } |
856 | 856 | ||
857 | if (file_type_specified && do_check) { | 857 | if (file_type_specified && do_check) { |
858 | error_msg_and_die("the -b and -t options are meaningless when verifying checksums\n"); | 858 | error_msg_and_die("the -b and -t options are meaningless when verifying checksums"); |
859 | } | 859 | } |
860 | 860 | ||
861 | if (n_strings > 0 && do_check) { | 861 | if (n_strings > 0 && do_check) { |
862 | error_msg_and_die("the -g and -c options are mutually exclusive\n"); | 862 | error_msg_and_die("the -g and -c options are mutually exclusive"); |
863 | } | 863 | } |
864 | 864 | ||
865 | if (status_only && !do_check) { | 865 | if (status_only && !do_check) { |
866 | error_msg_and_die("the -s option is meaningful only when verifying checksums\n"); | 866 | error_msg_and_die("the -s option is meaningful only when verifying checksums"); |
867 | } | 867 | } |
868 | 868 | ||
869 | if (warn && !do_check) { | 869 | if (warn && !do_check) { |
870 | error_msg_and_die("the -w option is meaningful only when verifying checksums\n"); | 870 | error_msg_and_die("the -w option is meaningful only when verifying checksums"); |
871 | } | 871 | } |
872 | 872 | ||
873 | if (n_strings > 0) { | 873 | if (n_strings > 0) { |
874 | size_t i; | 874 | size_t i; |
875 | 875 | ||
876 | if (optind < argc) { | 876 | if (optind < argc) { |
877 | error_msg_and_die("no files may be specified when using -g\n"); | 877 | error_msg_and_die("no files may be specified when using -g"); |
878 | } | 878 | } |
879 | for (i = 0; i < n_strings; ++i) { | 879 | for (i = 0; i < n_strings; ++i) { |
880 | size_t cnt; | 880 | size_t cnt; |
@@ -887,7 +887,7 @@ int md5sum_main(int argc, | |||
887 | } | 887 | } |
888 | } else if (do_check) { | 888 | } else if (do_check) { |
889 | if (optind + 1 < argc) { | 889 | if (optind + 1 < argc) { |
890 | error_msg("only one argument may be specified when using -c\n"); | 890 | error_msg("only one argument may be specified when using -c"); |
891 | } | 891 | } |
892 | 892 | ||
893 | err = md5_check ((optind == argc) ? "-" : argv[optind]); | 893 | err = md5_check ((optind == argc) ? "-" : argv[optind]); |
@@ -940,11 +940,11 @@ int md5sum_main(int argc, | |||
940 | } | 940 | } |
941 | 941 | ||
942 | if (fclose (stdout) == EOF) { | 942 | if (fclose (stdout) == EOF) { |
943 | error_msg_and_die("write error\n"); | 943 | error_msg_and_die("write error"); |
944 | } | 944 | } |
945 | 945 | ||
946 | if (have_read_stdin && fclose (stdin) == EOF) { | 946 | if (have_read_stdin && fclose (stdin) == EOF) { |
947 | error_msg_and_die("standard input\n"); | 947 | error_msg_and_die("standard input"); |
948 | } | 948 | } |
949 | 949 | ||
950 | if (err == 0) | 950 | if (err == 0) |
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 07b18713a..299f29806 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
@@ -52,7 +52,7 @@ extern int mkdir_main(int argc, char **argv) | |||
52 | /* Find the specified modes */ | 52 | /* Find the specified modes */ |
53 | mode = 0; | 53 | mode = 0; |
54 | if (parse_mode(*(++argv), &mode) == FALSE) { | 54 | if (parse_mode(*(++argv), &mode) == FALSE) { |
55 | error_msg_and_die("Unknown mode: %s\n", *argv); | 55 | error_msg_and_die("Unknown mode: %s", *argv); |
56 | } | 56 | } |
57 | /* Set the umask for this process so it doesn't | 57 | /* Set the umask for this process so it doesn't |
58 | * screw up whatever the user just entered. */ | 58 | * screw up whatever the user just entered. */ |
@@ -85,7 +85,7 @@ extern int mkdir_main(int argc, char **argv) | |||
85 | strcpy(buf, *argv); | 85 | strcpy(buf, *argv); |
86 | status = stat(buf, &statBuf); | 86 | status = stat(buf, &statBuf); |
87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { | 87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { |
88 | error_msg_and_die("%s: File exists\n", buf); | 88 | error_msg_and_die("%s: File exists", buf); |
89 | } | 89 | } |
90 | if (parentFlag == TRUE) { | 90 | if (parentFlag == TRUE) { |
91 | strcat(buf, "/"); | 91 | strcat(buf, "/"); |
diff --git a/coreutils/test.c b/coreutils/test.c index ba6feb033..6439e3a8a 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -184,7 +184,7 @@ test_main(int argc, char** argv) | |||
184 | 184 | ||
185 | if (strcmp(applet_name, "[") == 0) { | 185 | if (strcmp(applet_name, "[") == 0) { |
186 | if (strcmp(argv[--argc], "]")) | 186 | if (strcmp(argv[--argc], "]")) |
187 | error_msg_and_die("missing ]\n"); | 187 | error_msg_and_die("missing ]"); |
188 | argv[argc] = NULL; | 188 | argv[argc] = NULL; |
189 | } | 189 | } |
190 | /* Implement special cases from POSIX.2, section 4.62.4 */ | 190 | /* Implement special cases from POSIX.2, section 4.62.4 */ |
@@ -233,9 +233,9 @@ syntax(op, msg) | |||
233 | char *msg; | 233 | char *msg; |
234 | { | 234 | { |
235 | if (op && *op) | 235 | if (op && *op) |
236 | error_msg_and_die("%s: %s\n", op, msg); | 236 | error_msg_and_die("%s: %s", op, msg); |
237 | else | 237 | else |
238 | error_msg_and_die("%s\n", msg); | 238 | error_msg_and_die("%s", msg); |
239 | } | 239 | } |
240 | 240 | ||
241 | static int | 241 | static int |
@@ -470,13 +470,13 @@ getn(s) | |||
470 | r = strtol(s, &p, 10); | 470 | r = strtol(s, &p, 10); |
471 | 471 | ||
472 | if (errno != 0) | 472 | if (errno != 0) |
473 | error_msg_and_die("%s: out of range\n", s); | 473 | error_msg_and_die("%s: out of range", s); |
474 | 474 | ||
475 | while (isspace(*p)) | 475 | while (isspace(*p)) |
476 | p++; | 476 | p++; |
477 | 477 | ||
478 | if (*p) | 478 | if (*p) |
479 | error_msg_and_die("%s: bad number\n", s); | 479 | error_msg_and_die("%s: bad number", s); |
480 | 480 | ||
481 | return (int) r; | 481 | return (int) r; |
482 | } | 482 | } |
diff --git a/coreutils/tr.c b/coreutils/tr.c index 2717a92db..36f29de44 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -186,7 +186,7 @@ extern int tr_main(int argc, char **argv) | |||
186 | input_length = complement(input, input_length); | 186 | input_length = complement(input, input_length); |
187 | if (argv[index] != NULL) { | 187 | if (argv[index] != NULL) { |
188 | if (*argv[index] == '\0') | 188 | if (*argv[index] == '\0') |
189 | error_msg_and_die("STRING2 cannot be empty\n"); | 189 | error_msg_and_die("STRING2 cannot be empty"); |
190 | output_length = expand(argv[index], output); | 190 | output_length = expand(argv[index], output); |
191 | map(input, input_length, output, output_length); | 191 | map(input, input_length, output, output_length); |
192 | } | 192 | } |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index fcfcfd903..cccc52872 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -46,7 +46,7 @@ static int read_stduu (const char *inname) | |||
46 | char *p; | 46 | char *p; |
47 | 47 | ||
48 | if (fgets (buf, sizeof(buf), stdin) == NULL) { | 48 | if (fgets (buf, sizeof(buf), stdin) == NULL) { |
49 | error_msg("%s: Short file\n", inname); | 49 | error_msg("%s: Short file", inname); |
50 | return FALSE; | 50 | return FALSE; |
51 | } | 51 | } |
52 | p = buf; | 52 | p = buf; |
@@ -81,7 +81,7 @@ static int read_stduu (const char *inname) | |||
81 | 81 | ||
82 | if (fgets (buf, sizeof(buf), stdin) == NULL | 82 | if (fgets (buf, sizeof(buf), stdin) == NULL |
83 | || strcmp (buf, "end\n")) { | 83 | || strcmp (buf, "end\n")) { |
84 | error_msg("%s: No `end' line\n", inname); | 84 | error_msg("%s: No `end' line", inname); |
85 | return FALSE; | 85 | return FALSE; |
86 | } | 86 | } |
87 | 87 | ||
@@ -131,7 +131,7 @@ static int read_base64 (const char *inname) | |||
131 | unsigned char *p; | 131 | unsigned char *p; |
132 | 132 | ||
133 | if (fgets (buf, sizeof(buf), stdin) == NULL) { | 133 | if (fgets (buf, sizeof(buf), stdin) == NULL) { |
134 | error_msg("%s: Short file\n", inname); | 134 | error_msg("%s: Short file", inname); |
135 | return FALSE; | 135 | return FALSE; |
136 | } | 136 | } |
137 | p = buf; | 137 | p = buf; |
@@ -139,7 +139,7 @@ static int read_base64 (const char *inname) | |||
139 | if (memcmp (buf, "====", 4) == 0) | 139 | if (memcmp (buf, "====", 4) == 0) |
140 | break; | 140 | break; |
141 | if (last_data != 0) { | 141 | if (last_data != 0) { |
142 | error_msg("%s: data following `=' padding character\n", inname); | 142 | error_msg("%s: data following `=' padding character", inname); |
143 | return FALSE; | 143 | return FALSE; |
144 | } | 144 | } |
145 | 145 | ||
@@ -161,14 +161,14 @@ static int read_base64 (const char *inname) | |||
161 | 161 | ||
162 | while ((b64_tab[*p] & '\100') != 0) | 162 | while ((b64_tab[*p] & '\100') != 0) |
163 | if (*p == '\n' || *p++ == '=') { | 163 | if (*p == '\n' || *p++ == '=') { |
164 | error_msg("%s: illegal line\n", inname); | 164 | error_msg("%s: illegal line", inname); |
165 | return FALSE; | 165 | return FALSE; |
166 | } | 166 | } |
167 | c2 = b64_tab[*p++]; | 167 | c2 = b64_tab[*p++]; |
168 | 168 | ||
169 | while (b64_tab[*p] == '\177') | 169 | while (b64_tab[*p] == '\177') |
170 | if (*p++ == '\n') { | 170 | if (*p++ == '\n') { |
171 | error_msg("%s: illegal line\n", inname); | 171 | error_msg("%s: illegal line", inname); |
172 | return FALSE; | 172 | return FALSE; |
173 | } | 173 | } |
174 | if (*p == '=') { | 174 | if (*p == '=') { |
@@ -180,7 +180,7 @@ static int read_base64 (const char *inname) | |||
180 | 180 | ||
181 | while (b64_tab[*p] == '\177') | 181 | while (b64_tab[*p] == '\177') |
182 | if (*p++ == '\n') { | 182 | if (*p++ == '\n') { |
183 | error_msg("%s: illegal line\n", inname); | 183 | error_msg("%s: illegal line", inname); |
184 | return FALSE; | 184 | return FALSE; |
185 | } | 185 | } |
186 | putchar (c1 << 2 | c2 >> 4); | 186 | putchar (c1 << 2 | c2 >> 4); |
@@ -212,7 +212,7 @@ static int decode (const char *inname, | |||
212 | 212 | ||
213 | while (1) { | 213 | while (1) { |
214 | if (fgets (buf, sizeof (buf), stdin) == NULL) { | 214 | if (fgets (buf, sizeof (buf), stdin) == NULL) { |
215 | error_msg("%s: No `begin' line\n", inname); | 215 | error_msg("%s: No `begin' line", inname); |
216 | return FALSE; | 216 | return FALSE; |
217 | } | 217 | } |
218 | 218 | ||
@@ -237,13 +237,13 @@ static int decode (const char *inname, | |||
237 | while (*p != '/') | 237 | while (*p != '/') |
238 | ++p; | 238 | ++p; |
239 | if (*p == '\0') { | 239 | if (*p == '\0') { |
240 | error_msg("%s: Illegal ~user\n", inname); | 240 | error_msg("%s: Illegal ~user", inname); |
241 | return FALSE; | 241 | return FALSE; |
242 | } | 242 | } |
243 | *p++ = '\0'; | 243 | *p++ = '\0'; |
244 | pw = getpwnam (buf + 1); | 244 | pw = getpwnam (buf + 1); |
245 | if (pw == NULL) { | 245 | if (pw == NULL) { |
246 | error_msg("%s: No user `%s'\n", inname, buf + 1); | 246 | error_msg("%s: No user `%s'", inname, buf + 1); |
247 | return FALSE; | 247 | return FALSE; |
248 | } | 248 | } |
249 | n = strlen (pw->pw_dir); | 249 | n = strlen (pw->pw_dir); |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 5df49026b..73098ba26 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -142,7 +142,7 @@ static void encode() | |||
142 | } | 142 | } |
143 | 143 | ||
144 | if (ferror (stdin)) | 144 | if (ferror (stdin)) |
145 | error_msg("Read error\n"); | 145 | error_msg("Read error"); |
146 | 146 | ||
147 | if (trans_ptr == uu_std) { | 147 | if (trans_ptr == uu_std) { |
148 | putchar (ENC ('\0')); | 148 | putchar (ENC ('\0')); |
@@ -196,7 +196,7 @@ int uuencode_main (int argc, | |||
196 | encode(); | 196 | encode(); |
197 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); | 197 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); |
198 | if (ferror (stdout)) { | 198 | if (ferror (stdout)) { |
199 | error_msg("Write error\n"); | 199 | error_msg("Write error"); |
200 | return EXIT_FAILURE; | 200 | return EXIT_FAILURE; |
201 | } | 201 | } |
202 | return EXIT_SUCCESS; | 202 | return EXIT_SUCCESS; |
diff --git a/coreutils/whoami.c b/coreutils/whoami.c index 870ede43e..398e37315 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c | |||
@@ -38,5 +38,5 @@ extern int whoami_main(int argc, char **argv) | |||
38 | puts(user); | 38 | puts(user); |
39 | return EXIT_SUCCESS; | 39 | return EXIT_SUCCESS; |
40 | } | 40 | } |
41 | error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid); | 41 | error_msg_and_die("cannot find username for UID %u", (unsigned) uid); |
42 | } | 42 | } |
@@ -282,7 +282,7 @@ extern int cp_mv_main(int argc, char **argv) | |||
282 | if ((sb.st_ino == srcStatBuf.st_ino) && | 282 | if ((sb.st_ino == srcStatBuf.st_ino) && |
283 | (sb.st_dev == srcStatBuf.st_dev)) { | 283 | (sb.st_dev == srcStatBuf.st_dev)) { |
284 | error_msg("Cannot %s `%s' into a subdirectory of itself, " | 284 | error_msg("Cannot %s `%s' into a subdirectory of itself, " |
285 | "`%s/%s'\n", applet_name, baseSrcName, | 285 | "`%s/%s'", applet_name, baseSrcName, |
286 | baseDestName, baseSrcName); | 286 | baseDestName, baseSrcName); |
287 | state = -1; | 287 | state = -1; |
288 | continue; | 288 | continue; |
@@ -54,12 +54,12 @@ static void decompose_list(const char *list) | |||
54 | /* the list must contain only digits and no more than one minus sign */ | 54 | /* the list must contain only digits and no more than one minus sign */ |
55 | for (ptr = (char *)list; *ptr; ptr++) { | 55 | for (ptr = (char *)list; *ptr; ptr++) { |
56 | if (!isdigit(*ptr) && *ptr != '-') { | 56 | if (!isdigit(*ptr) && *ptr != '-') { |
57 | error_msg_and_die("invalid byte or field list\n"); | 57 | error_msg_and_die("invalid byte or field list"); |
58 | } | 58 | } |
59 | if (*ptr == '-') { | 59 | if (*ptr == '-') { |
60 | nminus++; | 60 | nminus++; |
61 | if (nminus > 1) { | 61 | if (nminus > 1) { |
62 | error_msg_and_die("invalid byte or field list\n"); | 62 | error_msg_and_die("invalid byte or field list"); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | } | 65 | } |
@@ -68,7 +68,7 @@ static void decompose_list(const char *list) | |||
68 | if (nminus == 0) { | 68 | if (nminus == 0) { |
69 | startpos = strtol(list, &ptr, 10); | 69 | startpos = strtol(list, &ptr, 10); |
70 | if (startpos == 0) { | 70 | if (startpos == 0) { |
71 | error_msg_and_die("missing list of fields\n"); | 71 | error_msg_and_die("missing list of fields"); |
72 | } | 72 | } |
73 | endpos = startpos; | 73 | endpos = startpos; |
74 | } | 74 | } |
@@ -188,14 +188,14 @@ extern int cut_main(int argc, char **argv) | |||
188 | case 'f': | 188 | case 'f': |
189 | /* make sure they didn't ask for two types of lists */ | 189 | /* make sure they didn't ask for two types of lists */ |
190 | if (part != 0) { | 190 | if (part != 0) { |
191 | error_msg_and_die("only one type of list may be specified\n"); | 191 | error_msg_and_die("only one type of list may be specified"); |
192 | } | 192 | } |
193 | part = (char)opt; | 193 | part = (char)opt; |
194 | decompose_list(optarg); | 194 | decompose_list(optarg); |
195 | break; | 195 | break; |
196 | case 'd': | 196 | case 'd': |
197 | if (strlen(optarg) > 1) { | 197 | if (strlen(optarg) > 1) { |
198 | error_msg_and_die("the delimiter must be a single character\n"); | 198 | error_msg_and_die("the delimiter must be a single character"); |
199 | } | 199 | } |
200 | delim = optarg[0]; | 200 | delim = optarg[0]; |
201 | break; | 201 | break; |
@@ -209,17 +209,17 @@ extern int cut_main(int argc, char **argv) | |||
209 | } | 209 | } |
210 | 210 | ||
211 | if (part == 0) { | 211 | if (part == 0) { |
212 | error_msg_and_die("you must specify a list of bytes, characters, or fields\n"); | 212 | error_msg_and_die("you must specify a list of bytes, characters, or fields"); |
213 | } | 213 | } |
214 | 214 | ||
215 | if (supress_non_delimited_lines && part != 'f') { | 215 | if (supress_non_delimited_lines && part != 'f') { |
216 | error_msg_and_die("suppressing non-delimited lines makes sense" | 216 | error_msg_and_die("suppressing non-delimited lines makes sense" |
217 | " only when operating on fields\n"); | 217 | " only when operating on fields"); |
218 | 218 | ||
219 | } | 219 | } |
220 | 220 | ||
221 | if (delim != '\t' && part != 'f') { | 221 | if (delim != '\t' && part != 'f') { |
222 | error_msg_and_die("a delimiter may be specified only when operating on fields\n"); | 222 | error_msg_and_die("a delimiter may be specified only when operating on fields"); |
223 | } | 223 | } |
224 | 224 | ||
225 | /* argv[(optind)..(argc-1)] should be names of file to process. If no | 225 | /* argv[(optind)..(argc-1)] should be names of file to process. If no |
@@ -14,14 +14,14 @@ static unsigned int pointer; | |||
14 | static void push(double a) | 14 | static void push(double a) |
15 | { | 15 | { |
16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) | 16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) |
17 | error_msg_and_die("stack overflow\n"); | 17 | error_msg_and_die("stack overflow"); |
18 | stack[pointer++] = a; | 18 | stack[pointer++] = a; |
19 | } | 19 | } |
20 | 20 | ||
21 | static double pop() | 21 | static double pop() |
22 | { | 22 | { |
23 | if (pointer == 0) | 23 | if (pointer == 0) |
24 | error_msg_and_die("stack underflow\n"); | 24 | error_msg_and_die("stack underflow"); |
25 | return stack[--pointer]; | 25 | return stack[--pointer]; |
26 | } | 26 | } |
27 | 27 | ||
@@ -120,7 +120,7 @@ static void stack_machine(const char *argument) | |||
120 | } | 120 | } |
121 | o++; | 121 | o++; |
122 | } | 122 | } |
123 | error_msg_and_die("%s: syntax error.\n", argument); | 123 | error_msg_and_die("%s: syntax error.", argument); |
124 | } | 124 | } |
125 | 125 | ||
126 | /* return pointer to next token in buffer and set *buffer to one char | 126 | /* return pointer to next token in buffer and set *buffer to one char |
@@ -76,7 +76,7 @@ int dd_main(int argc, char **argv) | |||
76 | sync = TRUE; | 76 | sync = TRUE; |
77 | buf += 4; | 77 | buf += 4; |
78 | } else { | 78 | } else { |
79 | error_msg_and_die("invalid conversion `%s'\n", argv[i]+5); | 79 | error_msg_and_die("invalid conversion `%s'", argv[i]+5); |
80 | } | 80 | } |
81 | if (buf[0] == '\0') | 81 | if (buf[0] == '\0') |
82 | break; | 82 | break; |
diff --git a/deallocvt.c b/deallocvt.c index fad7a2bb2..b51fbaef4 100644 --- a/deallocvt.c +++ b/deallocvt.c | |||
@@ -31,9 +31,9 @@ int deallocvt_main(int argc, char *argv[]) | |||
31 | for (i = 1; i < argc; i++) { | 31 | for (i = 1; i < argc; i++) { |
32 | num = atoi(argv[i]); | 32 | num = atoi(argv[i]); |
33 | if (num == 0) | 33 | if (num == 0) |
34 | error_msg("0: illegal VT number\n"); | 34 | error_msg("0: illegal VT number"); |
35 | else if (num == 1) | 35 | else if (num == 1) |
36 | error_msg("VT 1 cannot be deallocated\n"); | 36 | error_msg("VT 1 cannot be deallocated"); |
37 | else if (ioctl(fd, VT_DISALLOCATE, num)) | 37 | else if (ioctl(fd, VT_DISALLOCATE, num)) |
38 | perror_msg_and_die("VT_DISALLOCATE"); | 38 | perror_msg_and_die("VT_DISALLOCATE"); |
39 | } | 39 | } |
@@ -118,7 +118,7 @@ extern int df_main(int argc, char **argv) | |||
118 | for(i = optind; i < argc; i++) | 118 | for(i = optind; i < argc; i++) |
119 | { | 119 | { |
120 | if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) { | 120 | if ((mountEntry = find_mount_point(argv[i], mtab_file)) == 0) { |
121 | error_msg("%s: can't find mount point.\n", argv[i]); | 121 | error_msg("%s: can't find mount point.", argv[i]); |
122 | status = EXIT_FAILURE; | 122 | status = EXIT_FAILURE; |
123 | } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir)) | 123 | } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir)) |
124 | status = EXIT_FAILURE; | 124 | status = EXIT_FAILURE; |
diff --git a/dpkg_deb.c b/dpkg_deb.c index 3a789379b..3345c273f 100644 --- a/dpkg_deb.c +++ b/dpkg_deb.c | |||
@@ -118,7 +118,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
118 | extract_flag = TRUE; | 118 | extract_flag = TRUE; |
119 | strcpy(ar_filename, "data.tar.gz"); | 119 | strcpy(ar_filename, "data.tar.gz"); |
120 | if ( (optind + 2) > argc ) { | 120 | if ( (optind + 2) > argc ) { |
121 | error_msg_and_die("No directory specified\n"); | 121 | error_msg_and_die("No directory specified"); |
122 | } | 122 | } |
123 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); | 123 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); |
124 | strcpy(target_dir, argv[optind+1]); | 124 | strcpy(target_dir, argv[optind+1]); |
@@ -128,7 +128,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
128 | list_flag = TRUE; | 128 | list_flag = TRUE; |
129 | strcpy(ar_filename, "data.tar.gz"); | 129 | strcpy(ar_filename, "data.tar.gz"); |
130 | if ( (optind + 2) > argc ) { | 130 | if ( (optind + 2) > argc ) { |
131 | error_msg_and_die("No directory specified\n"); | 131 | error_msg_and_die("No directory specified"); |
132 | } | 132 | } |
133 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); | 133 | target_dir = (char *) xmalloc(strlen(argv[optind+1])); |
134 | strcpy(target_dir, argv[optind+1]); | 134 | strcpy(target_dir, argv[optind+1]); |
@@ -139,7 +139,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
139 | 139 | ||
140 | *ar_headers = get_headers(srcFd); | 140 | *ar_headers = get_headers(srcFd); |
141 | if (ar_headers->next==NULL) | 141 | if (ar_headers->next==NULL) |
142 | error_msg_and_die("Couldnt find %s in %s\n",ar_filename, argv[optind]); | 142 | error_msg_and_die("Couldnt find %s in %s", ar_filename, argv[optind]); |
143 | 143 | ||
144 | while (ar_headers->next != NULL) { | 144 | while (ar_headers->next != NULL) { |
145 | if (strcmp(ar_headers->name, ar_filename)==0) | 145 | if (strcmp(ar_headers->name, ar_filename)==0) |
@@ -154,7 +154,7 @@ extern int dpkg_deb_main(int argc, char **argv) | |||
154 | mkdir(target_dir, 0755); | 154 | mkdir(target_dir, 0755); |
155 | } | 155 | } |
156 | if (chdir(target_dir)==-1) { | 156 | if (chdir(target_dir)==-1) { |
157 | error_msg_and_die("Cannot change to dir %s\n",argv[optind+1]); | 157 | error_msg_and_die("Cannot change to dir %s", argv[optind+1]); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list); | 160 | status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list); |
diff --git a/dumpkmap.c b/dumpkmap.c index b2067b30c..4ab711e55 100644 --- a/dumpkmap.c +++ b/dumpkmap.c | |||
@@ -81,7 +81,7 @@ int dumpkmap_main(int argc, char **argv) | |||
81 | ke.kb_table = i; | 81 | ke.kb_table = i; |
82 | if (ioctl(fd, KDGKBENT, &ke) < 0) { | 82 | if (ioctl(fd, KDGKBENT, &ke) < 0) { |
83 | 83 | ||
84 | error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); | 84 | error_msg("ioctl returned: %s, %s, %s, %xqq", strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); |
85 | } | 85 | } |
86 | else { | 86 | else { |
87 | write(1,(void*)&ke.kb_value,2); | 87 | write(1,(void*)&ke.kb_value,2); |
diff --git a/editors/sed.c b/editors/sed.c index 73a9ad3ec..e0351c3b8 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -169,7 +169,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
169 | else if (my_str[idx] == '/') { | 169 | else if (my_str[idx] == '/') { |
170 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx); | 170 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx); |
171 | if (idx == -1) | 171 | if (idx == -1) |
172 | error_msg_and_die("unterminated match expression\n"); | 172 | error_msg_and_die("unterminated match expression"); |
173 | my_str[idx] = '\0'; | 173 | my_str[idx] = '\0'; |
174 | *regex = (regex_t *)xmalloc(sizeof(regex_t)); | 174 | *regex = (regex_t *)xmalloc(sizeof(regex_t)); |
175 | xregcomp(*regex, my_str+1, 0); | 175 | xregcomp(*regex, my_str+1, 0); |
@@ -177,7 +177,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
177 | } | 177 | } |
178 | else { | 178 | else { |
179 | error_msg("get_address: no address found in string\n" | 179 | error_msg("get_address: no address found in string\n" |
180 | "\t(you probably didn't check the string you passed me)\n"); | 180 | "\t(you probably didn't check the string you passed me)"); |
181 | idx = -1; | 181 | idx = -1; |
182 | } | 182 | } |
183 | 183 | ||
@@ -213,7 +213,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
213 | /* verify that the 's' is followed by something. That something | 213 | /* verify that the 's' is followed by something. That something |
214 | * (typically a 'slash') is now our regexp delimiter... */ | 214 | * (typically a 'slash') is now our regexp delimiter... */ |
215 | if (!substr[++idx]) | 215 | if (!substr[++idx]) |
216 | error_msg_and_die("bad format in substitution expression\n"); | 216 | error_msg_and_die("bad format in substitution expression"); |
217 | else | 217 | else |
218 | sed_cmd->delimiter=substr[idx]; | 218 | sed_cmd->delimiter=substr[idx]; |
219 | 219 | ||
@@ -221,7 +221,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
221 | oldidx = idx+1; | 221 | oldidx = idx+1; |
222 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); | 222 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); |
223 | if (idx == -1) | 223 | if (idx == -1) |
224 | error_msg_and_die("bad format in substitution expression\n"); | 224 | error_msg_and_die("bad format in substitution expression"); |
225 | match = strdup_substr(substr, oldidx, idx); | 225 | match = strdup_substr(substr, oldidx, idx); |
226 | 226 | ||
227 | /* determine the number of back references in the match string */ | 227 | /* determine the number of back references in the match string */ |
@@ -240,7 +240,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
240 | oldidx = idx+1; | 240 | oldidx = idx+1; |
241 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); | 241 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); |
242 | if (idx == -1) | 242 | if (idx == -1) |
243 | error_msg_and_die("bad format in substitution expression\n"); | 243 | error_msg_and_die("bad format in substitution expression"); |
244 | sed_cmd->replace = strdup_substr(substr, oldidx, idx); | 244 | sed_cmd->replace = strdup_substr(substr, oldidx, idx); |
245 | 245 | ||
246 | /* process the flags */ | 246 | /* process the flags */ |
@@ -260,7 +260,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
260 | if (strchr("; \t\v\n\r", substr[idx])) | 260 | if (strchr("; \t\v\n\r", substr[idx])) |
261 | goto out; | 261 | goto out; |
262 | /* else */ | 262 | /* else */ |
263 | error_msg_and_die("bad option in substitution expression\n"); | 263 | error_msg_and_die("bad option in substitution expression"); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
@@ -302,7 +302,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr) | |||
302 | */ | 302 | */ |
303 | 303 | ||
304 | if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r')) | 304 | if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r')) |
305 | error_msg_and_die("bad format in edit expression\n"); | 305 | error_msg_and_die("bad format in edit expression"); |
306 | 306 | ||
307 | /* store the edit line text */ | 307 | /* store the edit line text */ |
308 | /* make editline big enough to accomodate the extra '\n' we will tack on | 308 | /* make editline big enough to accomodate the extra '\n' we will tack on |
@@ -366,9 +366,9 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr) | |||
366 | 366 | ||
367 | /* last part (mandatory) will be a command */ | 367 | /* last part (mandatory) will be a command */ |
368 | if (cmdstr[idx] == '\0') | 368 | if (cmdstr[idx] == '\0') |
369 | error_msg_and_die("missing command\n"); | 369 | error_msg_and_die("missing command"); |
370 | if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */ | 370 | if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */ |
371 | error_msg_and_die("invalid command\n"); | 371 | error_msg_and_die("invalid command"); |
372 | sed_cmd->cmd = cmdstr[idx]; | 372 | sed_cmd->cmd = cmdstr[idx]; |
373 | 373 | ||
374 | /* special-case handling for (s)ubstitution */ | 374 | /* special-case handling for (s)ubstitution */ |
@@ -378,7 +378,7 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr) | |||
378 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ | 378 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ |
379 | else if (strchr("aic", cmdstr[idx])) { | 379 | else if (strchr("aic", cmdstr[idx])) { |
380 | if (sed_cmd->end_line || sed_cmd->end_match) | 380 | if (sed_cmd->end_line || sed_cmd->end_match) |
381 | error_msg_and_die("only a beginning address can be specified for edit commands\n"); | 381 | error_msg_and_die("only a beginning address can be specified for edit commands"); |
382 | idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]); | 382 | idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]); |
383 | } | 383 | } |
384 | /* if it was a single-letter command (such as 'p' or 'd') we need to | 384 | /* if it was a single-letter command (such as 'p' or 'd') we need to |
@@ -76,14 +76,14 @@ int expr_main (int argc, char **argv) | |||
76 | VALUE *v; | 76 | VALUE *v; |
77 | 77 | ||
78 | if (argc == 1) { | 78 | if (argc == 1) { |
79 | error_msg_and_die("too few arguments\n"); | 79 | error_msg_and_die("too few arguments"); |
80 | } | 80 | } |
81 | 81 | ||
82 | args = argv + 1; | 82 | args = argv + 1; |
83 | 83 | ||
84 | v = eval (); | 84 | v = eval (); |
85 | if (*args) | 85 | if (*args) |
86 | error_msg_and_die ("syntax error\n"); | 86 | error_msg_and_die ("syntax error"); |
87 | 87 | ||
88 | if (v->type == integer) | 88 | if (v->type == integer) |
89 | printf ("%d\n", v->u.i); | 89 | printf ("%d\n", v->u.i); |
@@ -218,7 +218,7 @@ static \ | |||
218 | int name (l, r) VALUE *l; VALUE *r; \ | 218 | int name (l, r) VALUE *l; VALUE *r; \ |
219 | { \ | 219 | { \ |
220 | if (!toarith (l) || !toarith (r)) \ | 220 | if (!toarith (l) || !toarith (r)) \ |
221 | error_msg_and_die ("non-numeric argument\n"); \ | 221 | error_msg_and_die ("non-numeric argument"); \ |
222 | return l->u.i op r->u.i; \ | 222 | return l->u.i op r->u.i; \ |
223 | } | 223 | } |
224 | 224 | ||
@@ -226,9 +226,9 @@ int name (l, r) VALUE *l; VALUE *r; \ | |||
226 | int name (l, r) VALUE *l; VALUE *r; \ | 226 | int name (l, r) VALUE *l; VALUE *r; \ |
227 | { \ | 227 | { \ |
228 | if (!toarith (l) || !toarith (r)) \ | 228 | if (!toarith (l) || !toarith (r)) \ |
229 | error_msg_and_die ( "non-numeric argument\n"); \ | 229 | error_msg_and_die ( "non-numeric argument"); \ |
230 | if (r->u.i == 0) \ | 230 | if (r->u.i == 0) \ |
231 | error_msg_and_die ( "division by zero\n"); \ | 231 | error_msg_and_die ( "division by zero"); \ |
232 | return l->u.i op r->u.i; \ | 232 | return l->u.i op r->u.i; \ |
233 | } | 233 | } |
234 | 234 | ||
@@ -272,7 +272,7 @@ of a basic regular expression is not portable; it is being ignored", | |||
272 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; | 272 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; |
273 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); | 273 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); |
274 | if (errmsg) { | 274 | if (errmsg) { |
275 | error_msg_and_die("%s\n", errmsg); | 275 | error_msg_and_die("%s", errmsg); |
276 | } | 276 | } |
277 | 277 | ||
278 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); | 278 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); |
@@ -303,19 +303,19 @@ static VALUE *eval7 (void) | |||
303 | VALUE *v; | 303 | VALUE *v; |
304 | 304 | ||
305 | if (!*args) | 305 | if (!*args) |
306 | error_msg_and_die ( "syntax error\n"); | 306 | error_msg_and_die ( "syntax error"); |
307 | 307 | ||
308 | if (nextarg ("(")) { | 308 | if (nextarg ("(")) { |
309 | args++; | 309 | args++; |
310 | v = eval (); | 310 | v = eval (); |
311 | if (!nextarg (")")) | 311 | if (!nextarg (")")) |
312 | error_msg_and_die ( "syntax error\n"); | 312 | error_msg_and_die ( "syntax error"); |
313 | args++; | 313 | args++; |
314 | return v; | 314 | return v; |
315 | } | 315 | } |
316 | 316 | ||
317 | if (nextarg (")")) | 317 | if (nextarg (")")) |
318 | error_msg_and_die ( "syntax error\n"); | 318 | error_msg_and_die ( "syntax error"); |
319 | 319 | ||
320 | return str_value (*args++); | 320 | return str_value (*args++); |
321 | } | 321 | } |
@@ -329,7 +329,7 @@ static VALUE *eval6 (void) | |||
329 | if (nextarg ("quote")) { | 329 | if (nextarg ("quote")) { |
330 | args++; | 330 | args++; |
331 | if (!*args) | 331 | if (!*args) |
332 | error_msg_and_die ( "syntax error\n"); | 332 | error_msg_and_die ( "syntax error"); |
333 | return str_value (*args++); | 333 | return str_value (*args++); |
334 | } | 334 | } |
335 | else if (nextarg ("length")) { | 335 | else if (nextarg ("length")) { |
@@ -284,7 +284,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn, | |||
284 | } | 284 | } |
285 | } | 285 | } |
286 | #else | 286 | #else |
287 | error_msg( "mode reading not compiled in\n"); | 287 | error_msg( "mode reading not compiled in"); |
288 | #endif | 288 | #endif |
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv) | |||
434 | perror_msg_and_die("fbset(ioctl)"); | 434 | perror_msg_and_die("fbset(ioctl)"); |
435 | if (g_options & OPT_READMODE) { | 435 | if (g_options & OPT_READMODE) { |
436 | if (!readmode(&var, modefile, mode)) { | 436 | if (!readmode(&var, modefile, mode)) { |
437 | error_msg("Unknown video mode `%s'\n", mode); | 437 | error_msg("Unknown video mode `%s'", mode); |
438 | return EXIT_FAILURE; | 438 | return EXIT_FAILURE; |
439 | } | 439 | } |
440 | } | 440 | } |
diff --git a/fsck_minix.c b/fsck_minix.c index 18841ec56..9d7622006 100644 --- a/fsck_minix.c +++ b/fsck_minix.c | |||
@@ -290,7 +290,7 @@ static void show_usage(void) | |||
290 | 290 | ||
291 | static void die(const char *str) | 291 | static void die(const char *str) |
292 | { | 292 | { |
293 | error_msg("%s\n", str); | 293 | error_msg("%s", str); |
294 | leave(8); | 294 | leave(8); |
295 | } | 295 | } |
296 | 296 | ||
@@ -258,7 +258,7 @@ void add_long_options(char *options) | |||
258 | arg_opt=required_argument; | 258 | arg_opt=required_argument; |
259 | } | 259 | } |
260 | if (strlen(tokptr) == 0) | 260 | if (strlen(tokptr) == 0) |
261 | error_msg("empty long option after -l or --long argument\n"); | 261 | error_msg("empty long option after -l or --long argument"); |
262 | } | 262 | } |
263 | add_longopt(tokptr,arg_opt); | 263 | add_longopt(tokptr,arg_opt); |
264 | } | 264 | } |
@@ -277,7 +277,7 @@ void set_shell(const char *new_shell) | |||
277 | else if (!strcmp(new_shell,"csh")) | 277 | else if (!strcmp(new_shell,"csh")) |
278 | shell=TCSH; | 278 | shell=TCSH; |
279 | else | 279 | else |
280 | error_msg("unknown shell after -s or --shell argument\n"); | 280 | error_msg("unknown shell after -s or --shell argument"); |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[]) | |||
326 | printf(" --\n"); | 326 | printf(" --\n"); |
327 | exit(0); | 327 | exit(0); |
328 | } else | 328 | } else |
329 | error_msg_and_die("missing optstring argument\n"); | 329 | error_msg_and_die("missing optstring argument"); |
330 | } | 330 | } |
331 | 331 | ||
332 | if (argv[1][0] != '-' || compatible) { | 332 | if (argv[1][0] != '-' || compatible) { |
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[]) | |||
377 | 377 | ||
378 | if (!optstr) { | 378 | if (!optstr) { |
379 | if (optind >= argc) | 379 | if (optind >= argc) |
380 | error_msg_and_die("missing optstring argument\n"); | 380 | error_msg_and_die("missing optstring argument"); |
381 | else { | 381 | else { |
382 | optstr=xmalloc(strlen(argv[optind])+1); | 382 | optstr=xmalloc(strlen(argv[optind])+1); |
383 | strcpy(optstr,argv[optind]); | 383 | strcpy(optstr,argv[optind]); |
@@ -297,7 +297,7 @@ int in; /* input file descriptor */ | |||
297 | 297 | ||
298 | method = (int) get_byte(); | 298 | method = (int) get_byte(); |
299 | if (method != DEFLATED) { | 299 | if (method != DEFLATED) { |
300 | error_msg("unknown method %d -- get newer version of gzip\n", method); | 300 | error_msg("unknown method %d -- get newer version of gzip", method); |
301 | exit_code = ERROR; | 301 | exit_code = ERROR; |
302 | return -1; | 302 | return -1; |
303 | } | 303 | } |
@@ -1116,11 +1116,11 @@ int in, out; /* input and output file descriptors */ | |||
1116 | if (res == 3) { | 1116 | if (res == 3) { |
1117 | error_msg(memory_exhausted); | 1117 | error_msg(memory_exhausted); |
1118 | } else if (res != 0) { | 1118 | } else if (res != 0) { |
1119 | error_msg("invalid compressed data--format violated\n"); | 1119 | error_msg("invalid compressed data--format violated"); |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | } else { | 1122 | } else { |
1123 | error_msg("internal error, invalid method\n"); | 1123 | error_msg("internal error, invalid method"); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | /* Get the crc and original length */ | 1126 | /* Get the crc and original length */ |
@@ -1149,15 +1149,15 @@ int in, out; /* input and output file descriptors */ | |||
1149 | 1149 | ||
1150 | /* Validate decompression */ | 1150 | /* Validate decompression */ |
1151 | if (orig_crc != updcrc(outbuf, 0)) { | 1151 | if (orig_crc != updcrc(outbuf, 0)) { |
1152 | error_msg("invalid compressed data--crc error\n"); | 1152 | error_msg("invalid compressed data--crc error"); |
1153 | } | 1153 | } |
1154 | if (orig_len != (ulg) bytes_out) { | 1154 | if (orig_len != (ulg) bytes_out) { |
1155 | error_msg("invalid compressed data--length error\n"); | 1155 | error_msg("invalid compressed data--length error"); |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | /* Check if there are more entries in a pkzip file */ | 1158 | /* Check if there are more entries in a pkzip file */ |
1159 | if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) { | 1159 | if (pkzip && inptr + 4 < insize && LG(inbuf + inptr) == LOCSIG) { |
1160 | fprintf(stderr, "has more than one entry--rest ignored\n"); | 1160 | error_msg("has more than one entry--rest ignored"); |
1161 | if (exit_code == OK) | 1161 | if (exit_code == OK) |
1162 | exit_code = WARNING; | 1162 | exit_code = WARNING; |
1163 | } | 1163 | } |
@@ -1261,9 +1261,9 @@ int gunzip_main(int argc, char **argv) | |||
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1263 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1264 | error_msg_and_die( "data not read from terminal. Use -f to force it.\n"); | 1264 | error_msg_and_die( "data not read from terminal. Use -f to force it."); |
1265 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) | 1265 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) |
1266 | error_msg_and_die( "data not written to terminal. Use -f to force it.\n"); | 1266 | error_msg_and_die( "data not written to terminal. Use -f to force it."); |
1267 | 1267 | ||
1268 | gunzip_init(); | 1268 | gunzip_init(); |
1269 | 1269 | ||
@@ -1382,7 +1382,7 @@ int length; | |||
1382 | (char *) window + start, length) != EQUAL) { | 1382 | (char *) window + start, length) != EQUAL) { |
1383 | fprintf(stderr, | 1383 | fprintf(stderr, |
1384 | " start %d, match %d, length %d\n", start, match, length); | 1384 | " start %d, match %d, length %d\n", start, match, length); |
1385 | error_msg("invalid match\n"); | 1385 | error_msg("invalid match"); |
1386 | } | 1386 | } |
1387 | if (verbose > 1) { | 1387 | if (verbose > 1) { |
1388 | fprintf(stderr, "\\[%d,%d]", start - match, length); | 1388 | fprintf(stderr, "\\[%d,%d]", start - match, length); |
@@ -1822,9 +1822,9 @@ int gzip_main(int argc, char **argv) | |||
1822 | } | 1822 | } |
1823 | 1823 | ||
1824 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1824 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1825 | error_msg_and_die( "data not read from terminal. Use -f to force it.\n"); | 1825 | error_msg_and_die( "data not read from terminal. Use -f to force it."); |
1826 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) | 1826 | if (isatty(fileno(stdout)) && tostdout==1 && force==0) |
1827 | error_msg_and_die( "data not written to terminal. Use -f to force it.\n"); | 1827 | error_msg_and_die( "data not written to terminal. Use -f to force it."); |
1828 | 1828 | ||
1829 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; | 1829 | foreground = signal(SIGINT, SIG_IGN) != SIG_IGN; |
1830 | if (foreground) { | 1830 | if (foreground) { |
@@ -2894,7 +2894,7 @@ int eof; /* true if this is the last block for a file */ | |||
2894 | #endif | 2894 | #endif |
2895 | /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ | 2895 | /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ |
2896 | if (buf == (char *) 0) | 2896 | if (buf == (char *) 0) |
2897 | error_msg("block vanished\n"); | 2897 | error_msg("block vanished"); |
2898 | 2898 | ||
2899 | copy_block(buf, (unsigned) stored_len, 0); /* without header */ | 2899 | copy_block(buf, (unsigned) stored_len, 0); /* without header */ |
2900 | compressed_len = stored_len << 3; | 2900 | compressed_len = stored_len << 3; |
@@ -3077,7 +3077,7 @@ local void set_file_type() | |||
3077 | bin_freq += dyn_ltree[n++].Freq; | 3077 | bin_freq += dyn_ltree[n++].Freq; |
3078 | *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; | 3078 | *file_type = bin_freq > (ascii_freq >> 2) ? BINARY : ASCII; |
3079 | if (*file_type == BINARY && translate_eol) { | 3079 | if (*file_type == BINARY && translate_eol) { |
3080 | error_msg("-l used on binary file\n"); | 3080 | error_msg("-l used on binary file"); |
3081 | } | 3081 | } |
3082 | } | 3082 | } |
3083 | 3083 | ||
@@ -3239,7 +3239,7 @@ char *env; /* name of environment variable */ | |||
3239 | 3239 | ||
3240 | /* Copy the program name first */ | 3240 | /* Copy the program name first */ |
3241 | if (oargc-- < 0) | 3241 | if (oargc-- < 0) |
3242 | error_msg("argc<=0\n"); | 3242 | error_msg("argc<=0"); |
3243 | *(nargv++) = *(oargv++); | 3243 | *(nargv++) = *(oargv++); |
3244 | 3244 | ||
3245 | /* Then copy the environment args */ | 3245 | /* Then copy the environment args */ |
diff --git a/hostname.c b/hostname.c index a789fa0f1..3dba64154 100644 --- a/hostname.c +++ b/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $ | 3 | * $Id: hostname.c,v 1.22 2001/01/31 19:00:20 kraai Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -41,7 +41,7 @@ void do_sethostname(char *s, int isfile) | |||
41 | if (!isfile) { | 41 | if (!isfile) { |
42 | if (sethostname(s, strlen(s)) < 0) { | 42 | if (sethostname(s, strlen(s)) < 0) { |
43 | if (errno == EPERM) | 43 | if (errno == EPERM) |
44 | error_msg_and_die("you must be root to change the hostname\n"); | 44 | error_msg_and_die("you must be root to change the hostname"); |
45 | else | 45 | else |
46 | perror_msg_and_die("sethostname"); | 46 | perror_msg_and_die("sethostname"); |
47 | } | 47 | } |
@@ -77,7 +77,7 @@ extern int id_main(int argc, char **argv) | |||
77 | pwnam=my_getpwnam(user); | 77 | pwnam=my_getpwnam(user); |
78 | grnam=my_getgrnam(group); | 78 | grnam=my_getgrnam(group); |
79 | if (gid == -1 || pwnam==-1 || grnam==-1) { | 79 | if (gid == -1 || pwnam==-1 || grnam==-1) { |
80 | error_msg_and_die("%s: No such user\n", user); | 80 | error_msg_and_die("%s: No such user", user); |
81 | } | 81 | } |
82 | 82 | ||
83 | if (no_group) { | 83 | if (no_group) { |
@@ -81,7 +81,7 @@ | |||
81 | #ifndef MODUTILS_MODULE_H | 81 | #ifndef MODUTILS_MODULE_H |
82 | static const int MODUTILS_MODULE_H = 1; | 82 | static const int MODUTILS_MODULE_H = 1; |
83 | 83 | ||
84 | #ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $" | 84 | #ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" |
85 | 85 | ||
86 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 86 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
87 | We do not use the kernel headers directly because we do not wish | 87 | We do not use the kernel headers directly because we do not wish |
@@ -287,7 +287,7 @@ int delete_module(const char *); | |||
287 | #ifndef MODUTILS_OBJ_H | 287 | #ifndef MODUTILS_OBJ_H |
288 | static const int MODUTILS_OBJ_H = 1; | 288 | static const int MODUTILS_OBJ_H = 1; |
289 | 289 | ||
290 | #ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $" | 290 | #ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" |
291 | 291 | ||
292 | /* The relocatable object is manipulated using elfin types. */ | 292 | /* The relocatable object is manipulated using elfin types. */ |
293 | 293 | ||
@@ -1156,7 +1156,7 @@ struct obj_symbol *obj_add_symbol(struct obj_file *f, const char *name, | |||
1156 | /* Don't report an error if the symbol is coming from | 1156 | /* Don't report an error if the symbol is coming from |
1157 | the kernel or some external module. */ | 1157 | the kernel or some external module. */ |
1158 | if (secidx <= SHN_HIRESERVE) | 1158 | if (secidx <= SHN_HIRESERVE) |
1159 | error_msg("%s multiply defined\n", name); | 1159 | error_msg("%s multiply defined", name); |
1160 | return sym; | 1160 | return sym; |
1161 | } | 1161 | } |
1162 | } | 1162 | } |
@@ -1419,7 +1419,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1419 | 1419 | ||
1420 | /* Also check that the parameter was not resolved from the kernel. */ | 1420 | /* Also check that the parameter was not resolved from the kernel. */ |
1421 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { | 1421 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { |
1422 | error_msg("symbol for parameter %s not found\n", p); | 1422 | error_msg("symbol for parameter %s not found", p); |
1423 | return 0; | 1423 | return 0; |
1424 | } | 1424 | } |
1425 | 1425 | ||
@@ -1432,7 +1432,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1432 | str = alloca(strlen(q)); | 1432 | str = alloca(strlen(q)); |
1433 | for (r = str, q++; *q != '"'; ++q, ++r) { | 1433 | for (r = str, q++; *q != '"'; ++q, ++r) { |
1434 | if (*q == '\0') { | 1434 | if (*q == '\0') { |
1435 | error_msg("improperly terminated string argument for %s\n", p); | 1435 | error_msg("improperly terminated string argument for %s", p); |
1436 | return 0; | 1436 | return 0; |
1437 | } else if (*q == '\\') | 1437 | } else if (*q == '\\') |
1438 | switch (*++q) { | 1438 | switch (*++q) { |
@@ -1786,7 +1786,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1786 | p = get_modinfo_value(f, key); | 1786 | p = get_modinfo_value(f, key); |
1787 | key += 5; | 1787 | key += 5; |
1788 | if (p == NULL) { | 1788 | if (p == NULL) { |
1789 | error_msg("invalid parameter %s\n", key); | 1789 | error_msg("invalid parameter %s", key); |
1790 | return 0; | 1790 | return 0; |
1791 | } | 1791 | } |
1792 | 1792 | ||
@@ -1794,7 +1794,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1794 | 1794 | ||
1795 | /* Also check that the parameter was not resolved from the kernel. */ | 1795 | /* Also check that the parameter was not resolved from the kernel. */ |
1796 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { | 1796 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { |
1797 | error_msg("symbol for parameter %s not found\n", key); | 1797 | error_msg("symbol for parameter %s not found", key); |
1798 | return 0; | 1798 | return 0; |
1799 | } | 1799 | } |
1800 | 1800 | ||
@@ -1822,7 +1822,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1822 | str = alloca(strlen(q)); | 1822 | str = alloca(strlen(q)); |
1823 | for (r = str, q++; *q != '"'; ++q, ++r) { | 1823 | for (r = str, q++; *q != '"'; ++q, ++r) { |
1824 | if (*q == '\0') { | 1824 | if (*q == '\0') { |
1825 | error_msg("improperly terminated string argument for %s\n", | 1825 | error_msg("improperly terminated string argument for %s", |
1826 | key); | 1826 | key); |
1827 | return 0; | 1827 | return 0; |
1828 | } else if (*q == '\\') | 1828 | } else if (*q == '\\') |
@@ -1917,14 +1917,14 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1917 | /* Probably we should do that outside the loop ? */ | 1917 | /* Probably we should do that outside the loop ? */ |
1918 | if (!isdigit(*(p + 1))) { | 1918 | if (!isdigit(*(p + 1))) { |
1919 | error_msg("parameter type 'c' for %s must be followed by" | 1919 | error_msg("parameter type 'c' for %s must be followed by" |
1920 | " the maximum size\n", key); | 1920 | " the maximum size", key); |
1921 | return 0; | 1921 | return 0; |
1922 | } | 1922 | } |
1923 | charssize = strtoul(p + 1, (char **) NULL, 10); | 1923 | charssize = strtoul(p + 1, (char **) NULL, 10); |
1924 | 1924 | ||
1925 | /* Check length */ | 1925 | /* Check length */ |
1926 | if (strlen(str) >= charssize) { | 1926 | if (strlen(str) >= charssize) { |
1927 | error_msg("string too long for %s (max %ld)\n", key, | 1927 | error_msg("string too long for %s (max %ld)", key, |
1928 | charssize - 1); | 1928 | charssize - 1); |
1929 | return 0; | 1929 | return 0; |
1930 | } | 1930 | } |
@@ -1953,7 +1953,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1953 | break; | 1953 | break; |
1954 | 1954 | ||
1955 | default: | 1955 | default: |
1956 | error_msg("unknown parameter type '%c' for %s\n", *p, key); | 1956 | error_msg("unknown parameter type '%c' for %s", *p, key); |
1957 | return 0; | 1957 | return 0; |
1958 | } | 1958 | } |
1959 | } | 1959 | } |
@@ -1972,21 +1972,21 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1972 | 1972 | ||
1973 | case ',': | 1973 | case ',': |
1974 | if (++n > max) { | 1974 | if (++n > max) { |
1975 | error_msg("too many values for %s (max %d)\n", key, max); | 1975 | error_msg("too many values for %s (max %d)", key, max); |
1976 | return 0; | 1976 | return 0; |
1977 | } | 1977 | } |
1978 | ++q; | 1978 | ++q; |
1979 | break; | 1979 | break; |
1980 | 1980 | ||
1981 | default: | 1981 | default: |
1982 | error_msg("invalid argument syntax for %s\n", key); | 1982 | error_msg("invalid argument syntax for %s", key); |
1983 | return 0; | 1983 | return 0; |
1984 | } | 1984 | } |
1985 | } | 1985 | } |
1986 | 1986 | ||
1987 | end_of_arg: | 1987 | end_of_arg: |
1988 | if (n < min) { | 1988 | if (n < min) { |
1989 | error_msg("too few values for %s (min %d)\n", key, min); | 1989 | error_msg("too few values for %s (min %d)", key, min); |
1990 | return 0; | 1990 | return 0; |
1991 | } | 1991 | } |
1992 | 1992 | ||
@@ -2372,7 +2372,7 @@ int obj_check_undefineds(struct obj_file *f) | |||
2372 | sym->secidx = SHN_ABS; | 2372 | sym->secidx = SHN_ABS; |
2373 | sym->value = 0; | 2373 | sym->value = 0; |
2374 | } else { | 2374 | } else { |
2375 | error_msg("unresolved symbol %s\n", sym->name); | 2375 | error_msg("unresolved symbol %s", sym->name); |
2376 | ret = 0; | 2376 | ret = 0; |
2377 | } | 2377 | } |
2378 | } | 2378 | } |
@@ -2599,11 +2599,11 @@ int obj_relocate(struct obj_file *f, ElfW(Addr) base) | |||
2599 | errmsg = "Unhandled relocation"; | 2599 | errmsg = "Unhandled relocation"; |
2600 | bad_reloc: | 2600 | bad_reloc: |
2601 | if (extsym) { | 2601 | if (extsym) { |
2602 | error_msg("%s of type %ld for %s\n", errmsg, | 2602 | error_msg("%s of type %ld for %s", errmsg, |
2603 | (long) ELFW(R_TYPE) (rel->r_info), | 2603 | (long) ELFW(R_TYPE) (rel->r_info), |
2604 | strtab + extsym->st_name); | 2604 | strtab + extsym->st_name); |
2605 | } else { | 2605 | } else { |
2606 | error_msg("%s of type %ld\n", errmsg, | 2606 | error_msg("%s of type %ld", errmsg, |
2607 | (long) ELFW(R_TYPE) (rel->r_info)); | 2607 | (long) ELFW(R_TYPE) (rel->r_info)); |
2608 | } | 2608 | } |
2609 | ret = 0; | 2609 | ret = 0; |
@@ -2688,25 +2688,25 @@ struct obj_file *obj_load(FILE * fp) | |||
2688 | || f->header.e_ident[EI_MAG1] != ELFMAG1 | 2688 | || f->header.e_ident[EI_MAG1] != ELFMAG1 |
2689 | || f->header.e_ident[EI_MAG2] != ELFMAG2 | 2689 | || f->header.e_ident[EI_MAG2] != ELFMAG2 |
2690 | || f->header.e_ident[EI_MAG3] != ELFMAG3) { | 2690 | || f->header.e_ident[EI_MAG3] != ELFMAG3) { |
2691 | error_msg("not an ELF file\n"); | 2691 | error_msg("not an ELF file"); |
2692 | return NULL; | 2692 | return NULL; |
2693 | } | 2693 | } |
2694 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM | 2694 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM |
2695 | || f->header.e_ident[EI_DATA] != ELFDATAM | 2695 | || f->header.e_ident[EI_DATA] != ELFDATAM |
2696 | || f->header.e_ident[EI_VERSION] != EV_CURRENT | 2696 | || f->header.e_ident[EI_VERSION] != EV_CURRENT |
2697 | || !MATCH_MACHINE(f->header.e_machine)) { | 2697 | || !MATCH_MACHINE(f->header.e_machine)) { |
2698 | error_msg("ELF file not for this architecture\n"); | 2698 | error_msg("ELF file not for this architecture"); |
2699 | return NULL; | 2699 | return NULL; |
2700 | } | 2700 | } |
2701 | if (f->header.e_type != ET_REL) { | 2701 | if (f->header.e_type != ET_REL) { |
2702 | error_msg("ELF file not a relocatable object\n"); | 2702 | error_msg("ELF file not a relocatable object"); |
2703 | return NULL; | 2703 | return NULL; |
2704 | } | 2704 | } |
2705 | 2705 | ||
2706 | /* Read the section headers. */ | 2706 | /* Read the section headers. */ |
2707 | 2707 | ||
2708 | if (f->header.e_shentsize != sizeof(ElfW(Shdr))) { | 2708 | if (f->header.e_shentsize != sizeof(ElfW(Shdr))) { |
2709 | error_msg("section header size mismatch: %lu != %lu\n", | 2709 | error_msg("section header size mismatch: %lu != %lu", |
2710 | (unsigned long) f->header.e_shentsize, | 2710 | (unsigned long) f->header.e_shentsize, |
2711 | (unsigned long) sizeof(ElfW(Shdr))); | 2711 | (unsigned long) sizeof(ElfW(Shdr))); |
2712 | return NULL; | 2712 | return NULL; |
@@ -2759,11 +2759,11 @@ struct obj_file *obj_load(FILE * fp) | |||
2759 | 2759 | ||
2760 | #if SHT_RELM == SHT_REL | 2760 | #if SHT_RELM == SHT_REL |
2761 | case SHT_RELA: | 2761 | case SHT_RELA: |
2762 | error_msg("RELA relocations not supported on this architecture\n"); | 2762 | error_msg("RELA relocations not supported on this architecture"); |
2763 | return NULL; | 2763 | return NULL; |
2764 | #else | 2764 | #else |
2765 | case SHT_REL: | 2765 | case SHT_REL: |
2766 | error_msg("REL relocations not supported on this architecture\n"); | 2766 | error_msg("REL relocations not supported on this architecture"); |
2767 | return NULL; | 2767 | return NULL; |
2768 | #endif | 2768 | #endif |
2769 | 2769 | ||
@@ -2776,7 +2776,7 @@ struct obj_file *obj_load(FILE * fp) | |||
2776 | break; | 2776 | break; |
2777 | } | 2777 | } |
2778 | 2778 | ||
2779 | error_msg("can't handle sections of type %ld\n", | 2779 | error_msg("can't handle sections of type %ld", |
2780 | (long) sec->header.sh_type); | 2780 | (long) sec->header.sh_type); |
2781 | return NULL; | 2781 | return NULL; |
2782 | } | 2782 | } |
@@ -2805,7 +2805,7 @@ struct obj_file *obj_load(FILE * fp) | |||
2805 | ElfW(Sym) * sym; | 2805 | ElfW(Sym) * sym; |
2806 | 2806 | ||
2807 | if (sec->header.sh_entsize != sizeof(ElfW(Sym))) { | 2807 | if (sec->header.sh_entsize != sizeof(ElfW(Sym))) { |
2808 | error_msg("symbol size mismatch: %lu != %lu\n", | 2808 | error_msg("symbol size mismatch: %lu != %lu", |
2809 | (unsigned long) sec->header.sh_entsize, | 2809 | (unsigned long) sec->header.sh_entsize, |
2810 | (unsigned long) sizeof(ElfW(Sym))); | 2810 | (unsigned long) sizeof(ElfW(Sym))); |
2811 | return NULL; | 2811 | return NULL; |
@@ -2837,7 +2837,7 @@ struct obj_file *obj_load(FILE * fp) | |||
2837 | 2837 | ||
2838 | case SHT_RELM: | 2838 | case SHT_RELM: |
2839 | if (sec->header.sh_entsize != sizeof(ElfW(RelM))) { | 2839 | if (sec->header.sh_entsize != sizeof(ElfW(RelM))) { |
2840 | error_msg("relocation entry size mismatch: %lu != %lu\n", | 2840 | error_msg("relocation entry size mismatch: %lu != %lu", |
2841 | (unsigned long) sec->header.sh_entsize, | 2841 | (unsigned long) sec->header.sh_entsize, |
2842 | (unsigned long) sizeof(ElfW(RelM))); | 2842 | (unsigned long) sizeof(ElfW(RelM))); |
2843 | return NULL; | 2843 | return NULL; |
@@ -2949,11 +2949,11 @@ extern int insmod_main( int argc, char **argv) | |||
2949 | if (m_filename[0] == '\0' | 2949 | if (m_filename[0] == '\0' |
2950 | || ((fp = fopen(m_filename, "r")) == NULL)) | 2950 | || ((fp = fopen(m_filename, "r")) == NULL)) |
2951 | { | 2951 | { |
2952 | error_msg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2952 | error_msg("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES); |
2953 | return EXIT_FAILURE; | 2953 | return EXIT_FAILURE; |
2954 | } | 2954 | } |
2955 | } else | 2955 | } else |
2956 | error_msg_and_die("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2956 | error_msg_and_die("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES); |
2957 | } else | 2957 | } else |
2958 | memcpy(m_filename, argv[optind], strlen(argv[optind])); | 2958 | memcpy(m_filename, argv[optind], strlen(argv[optind])); |
2959 | 2959 | ||
@@ -2976,7 +2976,7 @@ extern int insmod_main( int argc, char **argv) | |||
2976 | m_version = old_get_module_version(f, m_strversion); | 2976 | m_version = old_get_module_version(f, m_strversion); |
2977 | if (m_version == -1) { | 2977 | if (m_version == -1) { |
2978 | error_msg("couldn't find the kernel version the module was " | 2978 | error_msg("couldn't find the kernel version the module was " |
2979 | "compiled for\n"); | 2979 | "compiled for"); |
2980 | goto out; | 2980 | goto out; |
2981 | } | 2981 | } |
2982 | } | 2982 | } |
@@ -2985,12 +2985,12 @@ extern int insmod_main( int argc, char **argv) | |||
2985 | if (flag_force_load) { | 2985 | if (flag_force_load) { |
2986 | error_msg("Warning: kernel-module version mismatch\n" | 2986 | error_msg("Warning: kernel-module version mismatch\n" |
2987 | "\t%s was compiled for kernel version %s\n" | 2987 | "\t%s was compiled for kernel version %s\n" |
2988 | "\twhile this kernel is version %s\n", | 2988 | "\twhile this kernel is version %s", |
2989 | m_filename, m_strversion, k_strversion); | 2989 | m_filename, m_strversion, k_strversion); |
2990 | } else { | 2990 | } else { |
2991 | error_msg("kernel-module version mismatch\n" | 2991 | error_msg("kernel-module version mismatch\n" |
2992 | "\t%s was compiled for kernel version %s\n" | 2992 | "\t%s was compiled for kernel version %s\n" |
2993 | "\twhile this kernel is version %s.\n", | 2993 | "\twhile this kernel is version %s.", |
2994 | m_filename, m_strversion, k_strversion); | 2994 | m_filename, m_strversion, k_strversion); |
2995 | goto out; | 2995 | goto out; |
2996 | } | 2996 | } |
@@ -3006,7 +3006,7 @@ extern int insmod_main( int argc, char **argv) | |||
3006 | goto out; | 3006 | goto out; |
3007 | k_crcs = new_is_kernel_checksummed(); | 3007 | k_crcs = new_is_kernel_checksummed(); |
3008 | #else | 3008 | #else |
3009 | error_msg("Not configured to support new kernels\n"); | 3009 | error_msg("Not configured to support new kernels"); |
3010 | goto out; | 3010 | goto out; |
3011 | #endif | 3011 | #endif |
3012 | } else { | 3012 | } else { |
@@ -3015,7 +3015,7 @@ extern int insmod_main( int argc, char **argv) | |||
3015 | goto out; | 3015 | goto out; |
3016 | k_crcs = old_is_kernel_checksummed(); | 3016 | k_crcs = old_is_kernel_checksummed(); |
3017 | #else | 3017 | #else |
3018 | error_msg("Not configured to support old kernels\n"); | 3018 | error_msg("Not configured to support old kernels"); |
3019 | goto out; | 3019 | goto out; |
3020 | #endif | 3020 | #endif |
3021 | } | 3021 | } |
@@ -3072,10 +3072,10 @@ extern int insmod_main( int argc, char **argv) | |||
3072 | m_addr = create_module(m_name, m_size); | 3072 | m_addr = create_module(m_name, m_size); |
3073 | if (m_addr==-1) switch (errno) { | 3073 | if (m_addr==-1) switch (errno) { |
3074 | case EEXIST: | 3074 | case EEXIST: |
3075 | error_msg("A module named %s already exists\n", m_name); | 3075 | error_msg("A module named %s already exists", m_name); |
3076 | goto out; | 3076 | goto out; |
3077 | case ENOMEM: | 3077 | case ENOMEM: |
3078 | error_msg("Can't allocate kernel memory for module; needed %lu bytes\n", | 3078 | error_msg("Can't allocate kernel memory for module; needed %lu bytes", |
3079 | m_size); | 3079 | m_size); |
3080 | goto out; | 3080 | goto out; |
3081 | default: | 3081 | default: |
@@ -223,7 +223,7 @@ extern int kill_main(int argc, char **argv) | |||
223 | pidList = find_pid_by_name( *argv); | 223 | pidList = find_pid_by_name( *argv); |
224 | if (!pidList) { | 224 | if (!pidList) { |
225 | all_found = FALSE; | 225 | all_found = FALSE; |
226 | error_msg( "%s: no process killed\n", *argv); | 226 | error_msg( "%s: no process killed", *argv); |
227 | } | 227 | } |
228 | 228 | ||
229 | for(; pidList && *pidList!=0; pidList++) { | 229 | for(; pidList && *pidList!=0; pidList++) { |
@@ -246,5 +246,5 @@ extern int kill_main(int argc, char **argv) | |||
246 | 246 | ||
247 | 247 | ||
248 | end: | 248 | end: |
249 | error_msg_and_die( "bad signal name: %s\n", *argv); | 249 | error_msg_and_die( "bad signal name: %s", *argv); |
250 | } | 250 | } |
@@ -321,13 +321,13 @@ static int builtin_fg_bg(struct child_prog *child) | |||
321 | struct job *job=NULL; | 321 | struct job *job=NULL; |
322 | 322 | ||
323 | if (!child->argv[1] || child->argv[2]) { | 323 | if (!child->argv[1] || child->argv[2]) { |
324 | error_msg("%s: exactly one argument is expected\n", | 324 | error_msg("%s: exactly one argument is expected", |
325 | child->argv[0]); | 325 | child->argv[0]); |
326 | return EXIT_FAILURE; | 326 | return EXIT_FAILURE; |
327 | } | 327 | } |
328 | 328 | ||
329 | if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) { | 329 | if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) { |
330 | error_msg("%s: bad argument '%s'\n", | 330 | error_msg("%s: bad argument '%s'", |
331 | child->argv[0], child->argv[1]); | 331 | child->argv[0], child->argv[1]); |
332 | return EXIT_FAILURE; | 332 | return EXIT_FAILURE; |
333 | } | 333 | } |
@@ -339,7 +339,7 @@ static int builtin_fg_bg(struct child_prog *child) | |||
339 | } | 339 | } |
340 | 340 | ||
341 | if (!job) { | 341 | if (!job) { |
342 | error_msg("%s: unknown job %d\n", | 342 | error_msg("%s: unknown job %d", |
343 | child->argv[0], jobNum); | 343 | child->argv[0], jobNum); |
344 | return EXIT_FAILURE; | 344 | return EXIT_FAILURE; |
345 | } | 345 | } |
@@ -492,7 +492,7 @@ static int builtin_then(struct child_prog *child) | |||
492 | debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context); | 492 | debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context); |
493 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 493 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
494 | shell_context = 0; /* Reset the shell's context on an error */ | 494 | shell_context = 0; /* Reset the shell's context on an error */ |
495 | error_msg("%s `then'\n", syntax_err); | 495 | error_msg("%s `then'", syntax_err); |
496 | return EXIT_FAILURE; | 496 | return EXIT_FAILURE; |
497 | } | 497 | } |
498 | 498 | ||
@@ -520,7 +520,7 @@ static int builtin_else(struct child_prog *child) | |||
520 | 520 | ||
521 | if (! (cmd->job_context & THEN_EXP_CONTEXT)) { | 521 | if (! (cmd->job_context & THEN_EXP_CONTEXT)) { |
522 | shell_context = 0; /* Reset the shell's context on an error */ | 522 | shell_context = 0; /* Reset the shell's context on an error */ |
523 | error_msg("%s `else'\n", syntax_err); | 523 | error_msg("%s `else'", syntax_err); |
524 | return EXIT_FAILURE; | 524 | return EXIT_FAILURE; |
525 | } | 525 | } |
526 | /* If the if result was TRUE, skip the 'else' stuff */ | 526 | /* If the if result was TRUE, skip the 'else' stuff */ |
@@ -543,7 +543,7 @@ static int builtin_fi(struct child_prog *child) | |||
543 | debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context); | 543 | debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context); |
544 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 544 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
545 | shell_context = 0; /* Reset the shell's context on an error */ | 545 | shell_context = 0; /* Reset the shell's context on an error */ |
546 | error_msg("%s `fi'\n", syntax_err); | 546 | error_msg("%s `fi'", syntax_err); |
547 | return EXIT_FAILURE; | 547 | return EXIT_FAILURE; |
548 | } | 548 | } |
549 | /* Clear out the if and then context bits */ | 549 | /* Clear out the if and then context bits */ |
@@ -748,7 +748,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[]) | |||
748 | if (openfd < 0) { | 748 | if (openfd < 0) { |
749 | /* this could get lost if stderr has been redirected, but | 749 | /* this could get lost if stderr has been redirected, but |
750 | bash and ash both lose it as well (though zsh doesn't!) */ | 750 | bash and ash both lose it as well (though zsh doesn't!) */ |
751 | error_msg("error opening %s: %s\n", redir->filename, | 751 | error_msg("error opening %s: %s", redir->filename, |
752 | strerror(errno)); | 752 | strerror(errno)); |
753 | return 1; | 753 | return 1; |
754 | } | 754 | } |
@@ -960,7 +960,7 @@ static void expand_argument(struct child_prog *prog, int *argcPtr, | |||
960 | if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){ | 960 | if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){ |
961 | rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result); | 961 | rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result); |
962 | if (rc == GLOB_NOSPACE) { | 962 | if (rc == GLOB_NOSPACE) { |
963 | error_msg("out of space during glob operation\n"); | 963 | error_msg("out of space during glob operation"); |
964 | return; | 964 | return; |
965 | } else if (rc == GLOB_NOMATCH || | 965 | } else if (rc == GLOB_NOMATCH || |
966 | (!rc && (prog->glob_result.gl_pathc - i) == 1 && | 966 | (!rc && (prog->glob_result.gl_pathc - i) == 1 && |
@@ -1068,7 +1068,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1068 | if (*src == '\\') { | 1068 | if (*src == '\\') { |
1069 | src++; | 1069 | src++; |
1070 | if (!*src) { | 1070 | if (!*src) { |
1071 | error_msg("character expected after \\\n"); | 1071 | error_msg("character expected after \\"); |
1072 | free_job(job); | 1072 | free_job(job); |
1073 | return 1; | 1073 | return 1; |
1074 | } | 1074 | } |
@@ -1152,7 +1152,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1152 | chptr++; | 1152 | chptr++; |
1153 | 1153 | ||
1154 | if (!*chptr) { | 1154 | if (!*chptr) { |
1155 | error_msg("file name expected after %c\n", *src); | 1155 | error_msg("file name expected after %c", *src); |
1156 | free_job(job); | 1156 | free_job(job); |
1157 | job->num_progs=0; | 1157 | job->num_progs=0; |
1158 | return 1; | 1158 | return 1; |
@@ -1171,7 +1171,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1171 | if (*prog->argv[argc_l]) | 1171 | if (*prog->argv[argc_l]) |
1172 | argc_l++; | 1172 | argc_l++; |
1173 | if (!argc_l) { | 1173 | if (!argc_l) { |
1174 | error_msg("empty command in pipe\n"); | 1174 | error_msg("empty command in pipe"); |
1175 | free_job(job); | 1175 | free_job(job); |
1176 | job->num_progs=0; | 1176 | job->num_progs=0; |
1177 | return 1; | 1177 | return 1; |
@@ -1199,7 +1199,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1199 | src++; | 1199 | src++; |
1200 | 1200 | ||
1201 | if (!*src) { | 1201 | if (!*src) { |
1202 | error_msg("empty command in pipe\n"); | 1202 | error_msg("empty command in pipe"); |
1203 | free_job(job); | 1203 | free_job(job); |
1204 | job->num_progs=0; | 1204 | job->num_progs=0; |
1205 | return 1; | 1205 | return 1; |
@@ -1307,7 +1307,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1307 | printf("erik: found a continue char at EOL...\n"); | 1307 | printf("erik: found a continue char at EOL...\n"); |
1308 | command = (char *) xcalloc(BUFSIZ, sizeof(char)); | 1308 | command = (char *) xcalloc(BUFSIZ, sizeof(char)); |
1309 | if (get_command(input, command)) { | 1309 | if (get_command(input, command)) { |
1310 | error_msg("character expected after \\\n"); | 1310 | error_msg("character expected after \\"); |
1311 | free(command); | 1311 | free(command); |
1312 | free_job(job); | 1312 | free_job(job); |
1313 | return 1; | 1313 | return 1; |
@@ -1323,7 +1323,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1323 | free(command); | 1323 | free(command); |
1324 | break; | 1324 | break; |
1325 | #else | 1325 | #else |
1326 | error_msg("character expected after \\\n"); | 1326 | error_msg("character expected after \\"); |
1327 | free(command); | 1327 | free(command); |
1328 | free_job(job); | 1328 | free_job(job); |
1329 | return 1; | 1329 | return 1; |
@@ -1738,7 +1738,7 @@ int shell_main(int argc_l, char **argv_l) | |||
1738 | case 'c': | 1738 | case 'c': |
1739 | input = NULL; | 1739 | input = NULL; |
1740 | if (local_pending_command != 0) | 1740 | if (local_pending_command != 0) |
1741 | error_msg_and_die("multiple -c arguments\n"); | 1741 | error_msg_and_die("multiple -c arguments"); |
1742 | local_pending_command = xstrdup(argv[optind]); | 1742 | local_pending_command = xstrdup(argv[optind]); |
1743 | optind++; | 1743 | optind++; |
1744 | argv = argv+optind; | 1744 | argv = argv+optind; |
@@ -70,7 +70,7 @@ 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.\n"); | 73 | 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 | perror_msg_and_die("fseek failed reading binary 16bit screen-map"); |
76 | } | 76 | } |
@@ -79,7 +79,7 @@ int screen_map_load(int fd, FILE * fp) | |||
79 | perror_msg_and_die("Cannot read [new] map from file"); | 79 | 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.\n"); | 82 | error_msg("Input screen-map is binary."); |
83 | #endif | 83 | #endif |
84 | } | 84 | } |
85 | 85 | ||
@@ -96,7 +96,7 @@ 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.\n"), | 99 | 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 | perror_msg_and_die("fseek failed assuming 8bit screen-map"); |
@@ -109,7 +109,7 @@ 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 !\n"); | 112 | error_msg_and_die("fseek() returned ESPIPE !"); |
113 | else | 113 | else |
114 | perror_msg_and_die("fseek for binary 8bit screen-map"); | 114 | perror_msg_and_die("fseek for binary 8bit screen-map"); |
115 | } | 115 | } |
@@ -118,7 +118,7 @@ int screen_map_load(int fd, FILE * fp) | |||
118 | perror_msg_and_die("Cannot read [old] map from file"); | 118 | 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.\n"); | 121 | error_msg("Input screen-map is binary."); |
122 | #endif | 122 | #endif |
123 | } | 123 | } |
124 | 124 | ||
@@ -127,7 +127,7 @@ int screen_map_load(int fd, FILE * fp) | |||
127 | else | 127 | else |
128 | return 0; | 128 | return 0; |
129 | } | 129 | } |
130 | error_msg("Error parsing symbolic map\n"); | 130 | error_msg("Error parsing symbolic map"); |
131 | return(1); | 131 | return(1); |
132 | } | 132 | } |
133 | 133 | ||
diff --git a/loadfont.c b/loadfont.c index 08e07618e..ec3e50560 100644 --- a/loadfont.c +++ b/loadfont.c | |||
@@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize) | |||
62 | memset(buf, 0, sizeof(buf)); | 62 | memset(buf, 0, sizeof(buf)); |
63 | 63 | ||
64 | if (unit < 1 || unit > 32) | 64 | if (unit < 1 || unit > 32) |
65 | error_msg_and_die("Bad character size %d\n", unit); | 65 | error_msg_and_die("Bad character size %d", unit); |
66 | 66 | ||
67 | for (i = 0; i < fontsize; i++) | 67 | for (i = 0; i < fontsize; i++) |
68 | memcpy(buf + (32 * i), inbuf + (unit * i), unit); | 68 | memcpy(buf + (32 * i), inbuf + (unit * i), unit); |
@@ -119,8 +119,8 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize) | |||
119 | if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { | 119 | if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { |
120 | #ifdef ENOIOCTLCMD | 120 | #ifdef ENOIOCTLCMD |
121 | if (errno == ENOIOCTLCMD) { | 121 | if (errno == ENOIOCTLCMD) { |
122 | error_msg("It seems this kernel is older than 1.1.92\n"); | 122 | error_msg("It seems this kernel is older than 1.1.92"); |
123 | error_msg_and_die("No Unicode mapping table loaded.\n"); | 123 | error_msg_and_die("No Unicode mapping table loaded."); |
124 | } else | 124 | } else |
125 | #endif | 125 | #endif |
126 | perror_msg_and_die("PIO_UNIMAPCLR"); | 126 | perror_msg_and_die("PIO_UNIMAPCLR"); |
@@ -174,11 +174,11 @@ static void loadnewfont(int fd) | |||
174 | goto no_psf; | 174 | goto no_psf; |
175 | 175 | ||
176 | if (psfhdr.mode > PSF_MAXMODE) | 176 | if (psfhdr.mode > PSF_MAXMODE) |
177 | error_msg_and_die("Unsupported psf file mode\n"); | 177 | error_msg_and_die("Unsupported psf file mode"); |
178 | fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); | 178 | fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); |
179 | #if !defined( PIO_FONTX ) || defined( __sparc__ ) | 179 | #if !defined( PIO_FONTX ) || defined( __sparc__ ) |
180 | if (fontsize != 256) | 180 | if (fontsize != 256) |
181 | error_msg_and_die("Only fontsize 256 supported\n"); | 181 | error_msg_and_die("Only fontsize 256 supported"); |
182 | #endif | 182 | #endif |
183 | hastable = (psfhdr.mode & PSF_MODEHASTAB); | 183 | hastable = (psfhdr.mode & PSF_MODEHASTAB); |
184 | unit = psfhdr.charsize; | 184 | unit = psfhdr.charsize; |
@@ -186,7 +186,7 @@ static void loadnewfont(int fd) | |||
186 | 186 | ||
187 | head = head0 + fontsize * unit; | 187 | head = head0 + fontsize * unit; |
188 | if (head > inputlth || (!hastable && head != inputlth)) | 188 | if (head > inputlth || (!hastable && head != inputlth)) |
189 | error_msg_and_die("Input file: bad length\n"); | 189 | error_msg_and_die("Input file: bad length"); |
190 | do_loadfont(fd, inbuf + head0, unit, fontsize); | 190 | do_loadfont(fd, inbuf + head0, unit, fontsize); |
191 | if (hastable) | 191 | if (hastable) |
192 | do_loadtable(fd, inbuf + head, inputlth - head, fontsize); | 192 | do_loadtable(fd, inbuf + head, inputlth - head, fontsize); |
@@ -201,7 +201,7 @@ static void loadnewfont(int fd) | |||
201 | } else { | 201 | } else { |
202 | /* bare font */ | 202 | /* bare font */ |
203 | if (inputlth & 0377) | 203 | if (inputlth & 0377) |
204 | error_msg_and_die("Bad input file size\n"); | 204 | error_msg_and_die("Bad input file size"); |
205 | offset = 0; | 205 | offset = 0; |
206 | unit = inputlth / 256; | 206 | unit = inputlth / 256; |
207 | } | 207 | } |
diff --git a/loadkmap.c b/loadkmap.c index 75b40da9a..a98601aec 100644 --- a/loadkmap.c +++ b/loadkmap.c | |||
@@ -59,7 +59,7 @@ int loadkmap_main(int argc, char **argv) | |||
59 | 59 | ||
60 | read(0, buff, 7); | 60 | read(0, buff, 7); |
61 | if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) | 61 | if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) |
62 | error_msg_and_die("This is not a valid binary keymap.\n"); | 62 | error_msg_and_die("This is not a valid binary keymap."); |
63 | 63 | ||
64 | if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) | 64 | if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) |
65 | perror_msg_and_die("Error reading keymap flags"); | 65 | perror_msg_and_die("Error reading keymap flags"); |
@@ -87,14 +87,14 @@ static int pencode(char *s) | |||
87 | *s = '\0'; | 87 | *s = '\0'; |
88 | fac = decode(save, facilitynames); | 88 | fac = decode(save, facilitynames); |
89 | if (fac < 0) | 89 | if (fac < 0) |
90 | error_msg_and_die("unknown facility name: %s\n", save); | 90 | error_msg_and_die("unknown facility name: %s", save); |
91 | *s++ = '.'; | 91 | *s++ = '.'; |
92 | } else { | 92 | } else { |
93 | s = save; | 93 | s = save; |
94 | } | 94 | } |
95 | lev = decode(s, prioritynames); | 95 | lev = decode(s, prioritynames); |
96 | if (lev < 0) | 96 | if (lev < 0) |
97 | error_msg_and_die("unknown priority name: %s\n", save); | 97 | error_msg_and_die("unknown priority name: %s", save); |
98 | return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); | 98 | return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); |
99 | } | 99 | } |
100 | 100 | ||
@@ -37,5 +37,5 @@ extern int logname_main(int argc, char **argv) | |||
37 | puts(user); | 37 | puts(user); |
38 | return EXIT_SUCCESS; | 38 | return EXIT_SUCCESS; |
39 | } | 39 | } |
40 | error_msg_and_die("no login name\n"); | 40 | error_msg_and_die("no login name"); |
41 | } | 41 | } |
@@ -719,7 +719,7 @@ static int md5_check(const char *checkfile_name) | |||
719 | if (split_3(line, line_length, &md5num, &binary, &filename) | 719 | if (split_3(line, line_length, &md5num, &binary, &filename) |
720 | || !hex_digits(md5num)) { | 720 | || !hex_digits(md5num)) { |
721 | if (warn) { | 721 | if (warn) { |
722 | error_msg("%s: %lu: improperly formatted MD5 checksum line\n", | 722 | error_msg("%s: %lu: improperly formatted MD5 checksum line", |
723 | checkfile_name, (unsigned long) line_number); | 723 | checkfile_name, (unsigned long) line_number); |
724 | } | 724 | } |
725 | } else { | 725 | } else { |
@@ -764,7 +764,7 @@ static int md5_check(const char *checkfile_name) | |||
764 | while (!feof(checkfile_stream) && !ferror(checkfile_stream)); | 764 | while (!feof(checkfile_stream) && !ferror(checkfile_stream)); |
765 | 765 | ||
766 | if (ferror(checkfile_stream)) { | 766 | if (ferror(checkfile_stream)) { |
767 | error_msg("%s: read error\n", checkfile_name); /* */ | 767 | error_msg("%s: read error", checkfile_name); |
768 | return FALSE; | 768 | return FALSE; |
769 | } | 769 | } |
770 | 770 | ||
@@ -775,7 +775,7 @@ static int md5_check(const char *checkfile_name) | |||
775 | 775 | ||
776 | if (n_properly_formated_lines == 0) { | 776 | if (n_properly_formated_lines == 0) { |
777 | /* Warn if no tests are found. */ | 777 | /* Warn if no tests are found. */ |
778 | error_msg("%s: no properly formatted MD5 checksum lines found\n", | 778 | error_msg("%s: no properly formatted MD5 checksum lines found", |
779 | checkfile_name); | 779 | checkfile_name); |
780 | return FALSE; | 780 | return FALSE; |
781 | } else { | 781 | } else { |
@@ -784,13 +784,13 @@ static int md5_check(const char *checkfile_name) | |||
784 | - n_open_or_read_failures); | 784 | - n_open_or_read_failures); |
785 | 785 | ||
786 | if (n_open_or_read_failures > 0) { | 786 | if (n_open_or_read_failures > 0) { |
787 | error_msg("WARNING: %d of %d listed files could not be read\n", | 787 | error_msg("WARNING: %d of %d listed files could not be read", |
788 | n_open_or_read_failures, n_properly_formated_lines); | 788 | n_open_or_read_failures, n_properly_formated_lines); |
789 | return FALSE; | 789 | return FALSE; |
790 | } | 790 | } |
791 | 791 | ||
792 | if (n_mismatched_checksums > 0) { | 792 | if (n_mismatched_checksums > 0) { |
793 | error_msg("WARNING: %d of %d computed checksums did NOT match\n", | 793 | error_msg("WARNING: %d of %d computed checksums did NOT match", |
794 | n_mismatched_checksums, n_computed_checkums); | 794 | n_mismatched_checksums, n_computed_checkums); |
795 | return FALSE; | 795 | return FALSE; |
796 | } | 796 | } |
@@ -855,26 +855,26 @@ int md5sum_main(int argc, | |||
855 | } | 855 | } |
856 | 856 | ||
857 | if (file_type_specified && do_check) { | 857 | if (file_type_specified && do_check) { |
858 | error_msg_and_die("the -b and -t options are meaningless when verifying checksums\n"); | 858 | error_msg_and_die("the -b and -t options are meaningless when verifying checksums"); |
859 | } | 859 | } |
860 | 860 | ||
861 | if (n_strings > 0 && do_check) { | 861 | if (n_strings > 0 && do_check) { |
862 | error_msg_and_die("the -g and -c options are mutually exclusive\n"); | 862 | error_msg_and_die("the -g and -c options are mutually exclusive"); |
863 | } | 863 | } |
864 | 864 | ||
865 | if (status_only && !do_check) { | 865 | if (status_only && !do_check) { |
866 | error_msg_and_die("the -s option is meaningful only when verifying checksums\n"); | 866 | error_msg_and_die("the -s option is meaningful only when verifying checksums"); |
867 | } | 867 | } |
868 | 868 | ||
869 | if (warn && !do_check) { | 869 | if (warn && !do_check) { |
870 | error_msg_and_die("the -w option is meaningful only when verifying checksums\n"); | 870 | error_msg_and_die("the -w option is meaningful only when verifying checksums"); |
871 | } | 871 | } |
872 | 872 | ||
873 | if (n_strings > 0) { | 873 | if (n_strings > 0) { |
874 | size_t i; | 874 | size_t i; |
875 | 875 | ||
876 | if (optind < argc) { | 876 | if (optind < argc) { |
877 | error_msg_and_die("no files may be specified when using -g\n"); | 877 | error_msg_and_die("no files may be specified when using -g"); |
878 | } | 878 | } |
879 | for (i = 0; i < n_strings; ++i) { | 879 | for (i = 0; i < n_strings; ++i) { |
880 | size_t cnt; | 880 | size_t cnt; |
@@ -887,7 +887,7 @@ int md5sum_main(int argc, | |||
887 | } | 887 | } |
888 | } else if (do_check) { | 888 | } else if (do_check) { |
889 | if (optind + 1 < argc) { | 889 | if (optind + 1 < argc) { |
890 | error_msg("only one argument may be specified when using -c\n"); | 890 | error_msg("only one argument may be specified when using -c"); |
891 | } | 891 | } |
892 | 892 | ||
893 | err = md5_check ((optind == argc) ? "-" : argv[optind]); | 893 | err = md5_check ((optind == argc) ? "-" : argv[optind]); |
@@ -940,11 +940,11 @@ int md5sum_main(int argc, | |||
940 | } | 940 | } |
941 | 941 | ||
942 | if (fclose (stdout) == EOF) { | 942 | if (fclose (stdout) == EOF) { |
943 | error_msg_and_die("write error\n"); | 943 | error_msg_and_die("write error"); |
944 | } | 944 | } |
945 | 945 | ||
946 | if (have_read_stdin && fclose (stdin) == EOF) { | 946 | if (have_read_stdin && fclose (stdin) == EOF) { |
947 | error_msg_and_die("standard input\n"); | 947 | error_msg_and_die("standard input"); |
948 | } | 948 | } |
949 | 949 | ||
950 | if (err == 0) | 950 | if (err == 0) |
diff --git a/messages.c b/messages.c index c06a87f01..d9a134281 100644 --- a/messages.c +++ b/messages.c | |||
@@ -52,37 +52,37 @@ | |||
52 | "BusyBox v" BB_VER " (" BB_BT ") multi-call binary -- GPL2") | 52 | "BusyBox v" BB_VER " (" BB_BT ") multi-call binary -- GPL2") |
53 | #endif | 53 | #endif |
54 | #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN | 54 | #if defined bb_need_name_too_long || ! defined BB_DECLARE_EXTERN |
55 | BB_DEF_MESSAGE(name_too_long, "file name too long\n") | 55 | BB_DEF_MESSAGE(name_too_long, "file name too long") |
56 | #endif | 56 | #endif |
57 | #if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN | 57 | #if defined bb_need_omitting_directory || ! defined BB_DECLARE_EXTERN |
58 | BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory\n") | 58 | BB_DEF_MESSAGE(omitting_directory, "%s: omitting directory") |
59 | #endif | 59 | #endif |
60 | #if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN | 60 | #if defined bb_need_not_a_directory || ! defined BB_DECLARE_EXTERN |
61 | BB_DEF_MESSAGE(not_a_directory, "%s: not a directory\n") | 61 | BB_DEF_MESSAGE(not_a_directory, "%s: not a directory") |
62 | #endif | 62 | #endif |
63 | #if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN | 63 | #if defined bb_need_memory_exhausted || ! defined BB_DECLARE_EXTERN |
64 | BB_DEF_MESSAGE(memory_exhausted, "memory exhausted\n") | 64 | BB_DEF_MESSAGE(memory_exhausted, "memory exhausted") |
65 | #endif | 65 | #endif |
66 | #if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN | 66 | #if defined bb_need_invalid_date || ! defined BB_DECLARE_EXTERN |
67 | BB_DEF_MESSAGE(invalid_date, "invalid date `%s'\n") | 67 | BB_DEF_MESSAGE(invalid_date, "invalid date `%s'") |
68 | #endif | 68 | #endif |
69 | #if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN | 69 | #if defined bb_need_invalid_option || ! defined BB_DECLARE_EXTERN |
70 | BB_DEF_MESSAGE(invalid_option, "invalid option -- %c\n") | 70 | BB_DEF_MESSAGE(invalid_option, "invalid option -- %c") |
71 | #endif | 71 | #endif |
72 | #if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN | 72 | #if defined bb_need_io_error || ! defined BB_DECLARE_EXTERN |
73 | BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s\n") | 73 | BB_DEF_MESSAGE(io_error, "%s: input/output error -- %s") |
74 | #endif | 74 | #endif |
75 | #if defined bb_need_help || ! defined BB_DECLARE_EXTERN | 75 | #if defined bb_need_help || ! defined BB_DECLARE_EXTERN |
76 | BB_DEF_MESSAGE(dash_dash_help, "--help") | 76 | BB_DEF_MESSAGE(dash_dash_help, "--help") |
77 | #endif | 77 | #endif |
78 | #if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN | 78 | #if defined bb_need_write_error || ! defined BB_DECLARE_EXTERN |
79 | BB_DEF_MESSAGE(write_error, "Write Error\n") | 79 | BB_DEF_MESSAGE(write_error, "Write Error") |
80 | #endif | 80 | #endif |
81 | #if defined bb_need_too_few_args || ! defined BB_DECLARE_EXTERN | 81 | #if defined bb_need_too_few_args || ! defined BB_DECLARE_EXTERN |
82 | BB_DEF_MESSAGE(too_few_args, "too few arguments\n") | 82 | BB_DEF_MESSAGE(too_few_args, "too few arguments") |
83 | #endif | 83 | #endif |
84 | #if defined bb_need_name_longer_than_foo || ! defined BB_DECLARE_EXTERN | 84 | #if defined bb_need_name_longer_than_foo || ! defined BB_DECLARE_EXTERN |
85 | BB_DEF_MESSAGE(name_longer_than_foo, "Names longer than %d chars not supported.\n") | 85 | BB_DEF_MESSAGE(name_longer_than_foo, "Names longer than %d chars not supported.") |
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | 88 | ||
diff --git a/miscutils/dc.c b/miscutils/dc.c index d462100a2..122673a95 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c | |||
@@ -14,14 +14,14 @@ static unsigned int pointer; | |||
14 | static void push(double a) | 14 | static void push(double a) |
15 | { | 15 | { |
16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) | 16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) |
17 | error_msg_and_die("stack overflow\n"); | 17 | error_msg_and_die("stack overflow"); |
18 | stack[pointer++] = a; | 18 | stack[pointer++] = a; |
19 | } | 19 | } |
20 | 20 | ||
21 | static double pop() | 21 | static double pop() |
22 | { | 22 | { |
23 | if (pointer == 0) | 23 | if (pointer == 0) |
24 | error_msg_and_die("stack underflow\n"); | 24 | error_msg_and_die("stack underflow"); |
25 | return stack[--pointer]; | 25 | return stack[--pointer]; |
26 | } | 26 | } |
27 | 27 | ||
@@ -120,7 +120,7 @@ static void stack_machine(const char *argument) | |||
120 | } | 120 | } |
121 | o++; | 121 | o++; |
122 | } | 122 | } |
123 | error_msg_and_die("%s: syntax error.\n", argument); | 123 | error_msg_and_die("%s: syntax error.", argument); |
124 | } | 124 | } |
125 | 125 | ||
126 | /* return pointer to next token in buffer and set *buffer to one char | 126 | /* return pointer to next token in buffer and set *buffer to one char |
diff --git a/miscutils/mt.c b/miscutils/mt.c index 0d28339b9..683804b5a 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c | |||
@@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | if (code->name == 0) { | 78 | if (code->name == 0) { |
79 | error_msg("unrecognized opcode %s.\n", argv[1]); | 79 | error_msg("unrecognized opcode %s.", argv[1]); |
80 | return EXIT_FAILURE; | 80 | return EXIT_FAILURE; |
81 | } | 81 | } |
82 | 82 | ||
@@ -52,7 +52,7 @@ extern int mkdir_main(int argc, char **argv) | |||
52 | /* Find the specified modes */ | 52 | /* Find the specified modes */ |
53 | mode = 0; | 53 | mode = 0; |
54 | if (parse_mode(*(++argv), &mode) == FALSE) { | 54 | if (parse_mode(*(++argv), &mode) == FALSE) { |
55 | error_msg_and_die("Unknown mode: %s\n", *argv); | 55 | error_msg_and_die("Unknown mode: %s", *argv); |
56 | } | 56 | } |
57 | /* Set the umask for this process so it doesn't | 57 | /* Set the umask for this process so it doesn't |
58 | * screw up whatever the user just entered. */ | 58 | * screw up whatever the user just entered. */ |
@@ -85,7 +85,7 @@ extern int mkdir_main(int argc, char **argv) | |||
85 | strcpy(buf, *argv); | 85 | strcpy(buf, *argv); |
86 | status = stat(buf, &statBuf); | 86 | status = stat(buf, &statBuf); |
87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { | 87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { |
88 | error_msg_and_die("%s: File exists\n", buf); | 88 | error_msg_and_die("%s: File exists", buf); |
89 | } | 89 | } |
90 | if (parentFlag == TRUE) { | 90 | if (parentFlag == TRUE) { |
91 | strcat(buf, "/"); | 91 | strcat(buf, "/"); |
diff --git a/mkfs_minix.c b/mkfs_minix.c index 21965d3b1..a2b6d8a6e 100644 --- a/mkfs_minix.c +++ b/mkfs_minix.c | |||
@@ -279,7 +279,7 @@ static void check_mount(void) | |||
279 | if (!mnt) | 279 | if (!mnt) |
280 | return; | 280 | return; |
281 | 281 | ||
282 | error_msg_and_die("%s is mounted; will not make a filesystem here!\n", device_name); | 282 | error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name); |
283 | } | 283 | } |
284 | 284 | ||
285 | static long valid_offset(int fd, int offset) | 285 | static long valid_offset(int fd, int offset) |
@@ -336,28 +336,28 @@ static void write_tables(void) | |||
336 | Super.s_state &= ~MINIX_ERROR_FS; | 336 | Super.s_state &= ~MINIX_ERROR_FS; |
337 | 337 | ||
338 | if (lseek(DEV, 0, SEEK_SET)) | 338 | if (lseek(DEV, 0, SEEK_SET)) |
339 | error_msg_and_die("seek to boot block failed in write_tables\n"); | 339 | error_msg_and_die("seek to boot block failed in write_tables"); |
340 | if (512 != write(DEV, boot_block_buffer, 512)) | 340 | if (512 != write(DEV, boot_block_buffer, 512)) |
341 | error_msg_and_die("unable to clear boot sector\n"); | 341 | error_msg_and_die("unable to clear boot sector"); |
342 | if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET)) | 342 | if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET)) |
343 | error_msg_and_die("seek failed in write_tables\n"); | 343 | error_msg_and_die("seek failed in write_tables"); |
344 | if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE)) | 344 | if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE)) |
345 | error_msg_and_die("unable to write super-block\n"); | 345 | error_msg_and_die("unable to write super-block"); |
346 | if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE)) | 346 | if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE)) |
347 | error_msg_and_die("unable to write inode map\n"); | 347 | error_msg_and_die("unable to write inode map"); |
348 | if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE)) | 348 | if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE)) |
349 | error_msg_and_die("unable to write zone map\n"); | 349 | error_msg_and_die("unable to write zone map"); |
350 | if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE)) | 350 | if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE)) |
351 | error_msg_and_die("unable to write inodes\n"); | 351 | error_msg_and_die("unable to write inodes"); |
352 | 352 | ||
353 | } | 353 | } |
354 | 354 | ||
355 | static void write_block(int blk, char *buffer) | 355 | static void write_block(int blk, char *buffer) |
356 | { | 356 | { |
357 | if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET)) | 357 | if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET)) |
358 | error_msg_and_die("seek failed in write_block\n"); | 358 | error_msg_and_die("seek failed in write_block"); |
359 | if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE)) | 359 | if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE)) |
360 | error_msg_and_die("write failed in write_block\n"); | 360 | error_msg_and_die("write failed in write_block"); |
361 | } | 361 | } |
362 | 362 | ||
363 | static int get_free_block(void) | 363 | static int get_free_block(void) |
@@ -365,7 +365,7 @@ static int get_free_block(void) | |||
365 | int blk; | 365 | int blk; |
366 | 366 | ||
367 | if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS) | 367 | if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS) |
368 | error_msg_and_die("too many bad blocks\n"); | 368 | error_msg_and_die("too many bad blocks"); |
369 | if (used_good_blocks) | 369 | if (used_good_blocks) |
370 | blk = good_blocks_table[used_good_blocks - 1] + 1; | 370 | blk = good_blocks_table[used_good_blocks - 1] + 1; |
371 | else | 371 | else |
@@ -373,7 +373,7 @@ static int get_free_block(void) | |||
373 | while (blk < ZONES && zone_in_use(blk)) | 373 | while (blk < ZONES && zone_in_use(blk)) |
374 | blk++; | 374 | blk++; |
375 | if (blk >= ZONES) | 375 | if (blk >= ZONES) |
376 | error_msg_and_die("not enough good blocks\n"); | 376 | error_msg_and_die("not enough good blocks"); |
377 | good_blocks_table[used_good_blocks] = blk; | 377 | good_blocks_table[used_good_blocks] = blk; |
378 | used_good_blocks++; | 378 | used_good_blocks++; |
379 | return blk; | 379 | return blk; |
@@ -439,7 +439,7 @@ static void make_bad_inode(void) | |||
439 | goto end_bad; | 439 | goto end_bad; |
440 | } | 440 | } |
441 | } | 441 | } |
442 | error_msg_and_die("too many bad blocks\n"); | 442 | error_msg_and_die("too many bad blocks"); |
443 | end_bad: | 443 | end_bad: |
444 | if (ind) | 444 | if (ind) |
445 | write_block(ind, (char *) ind_block); | 445 | write_block(ind, (char *) ind_block); |
@@ -489,7 +489,7 @@ static void make_bad_inode2(void) | |||
489 | } | 489 | } |
490 | } | 490 | } |
491 | /* Could make triple indirect block here */ | 491 | /* Could make triple indirect block here */ |
492 | error_msg_and_die("too many bad blocks\n"); | 492 | error_msg_and_die("too many bad blocks"); |
493 | end_bad: | 493 | end_bad: |
494 | if (ind) | 494 | if (ind) |
495 | write_block(ind, (char *) ind_block); | 495 | write_block(ind, (char *) ind_block); |
@@ -590,7 +590,7 @@ static void setup_tables(void) | |||
590 | * /sbin/mkfs.minix -i 200 test.fs | 590 | * /sbin/mkfs.minix -i 200 test.fs |
591 | * */ | 591 | * */ |
592 | if (i >= 999) { | 592 | if (i >= 999) { |
593 | error_msg_and_die("unable to allocate buffers for maps\n"); | 593 | error_msg_and_die("unable to allocate buffers for maps"); |
594 | } | 594 | } |
595 | FIRSTZONE = NORM_FIRSTZONE; | 595 | FIRSTZONE = NORM_FIRSTZONE; |
596 | inode_map = xmalloc(IMAPS * BLOCK_SIZE); | 596 | inode_map = xmalloc(IMAPS * BLOCK_SIZE); |
@@ -621,7 +621,7 @@ long do_check(char *buffer, int try, unsigned int current_block) | |||
621 | /* Seek to the correct loc. */ | 621 | /* Seek to the correct loc. */ |
622 | if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) != | 622 | if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) != |
623 | current_block * BLOCK_SIZE) { | 623 | current_block * BLOCK_SIZE) { |
624 | error_msg_and_die("seek failed during testing of blocks\n"); | 624 | error_msg_and_die("seek failed during testing of blocks"); |
625 | } | 625 | } |
626 | 626 | ||
627 | 627 | ||
@@ -661,7 +661,7 @@ static void check_blocks(void) | |||
661 | while (currently_testing < ZONES) { | 661 | while (currently_testing < ZONES) { |
662 | if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) != | 662 | if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) != |
663 | currently_testing * BLOCK_SIZE) | 663 | currently_testing * BLOCK_SIZE) |
664 | error_msg_and_die("seek failed in check_blocks\n"); | 664 | error_msg_and_die("seek failed in check_blocks"); |
665 | try = TEST_BUFFER_BLOCKS; | 665 | try = TEST_BUFFER_BLOCKS; |
666 | if (currently_testing + try > ZONES) | 666 | if (currently_testing + try > ZONES) |
667 | try = ZONES - currently_testing; | 667 | try = ZONES - currently_testing; |
@@ -670,7 +670,7 @@ static void check_blocks(void) | |||
670 | if (got == try) | 670 | if (got == try) |
671 | continue; | 671 | continue; |
672 | if (currently_testing < FIRSTZONE) | 672 | if (currently_testing < FIRSTZONE) |
673 | error_msg_and_die("bad blocks before data-area: cannot make fs\n"); | 673 | error_msg_and_die("bad blocks before data-area: cannot make fs"); |
674 | mark_zone(currently_testing); | 674 | mark_zone(currently_testing); |
675 | badblocks++; | 675 | badblocks++; |
676 | currently_testing++; | 676 | currently_testing++; |
@@ -690,7 +690,7 @@ char *filename; | |||
690 | 690 | ||
691 | listfile = fopen(filename, "r"); | 691 | listfile = fopen(filename, "r"); |
692 | if (listfile == (FILE *) NULL) { | 692 | if (listfile == (FILE *) NULL) { |
693 | error_msg_and_die("can't open file of bad blocks\n"); | 693 | error_msg_and_die("can't open file of bad blocks"); |
694 | } | 694 | } |
695 | while (!feof(listfile)) { | 695 | while (!feof(listfile)) { |
696 | fscanf(listfile, "%ld\n", &blockno); | 696 | fscanf(listfile, "%ld\n", &blockno); |
@@ -712,10 +712,10 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
712 | int stopIt=FALSE; | 712 | int stopIt=FALSE; |
713 | 713 | ||
714 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) | 714 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) |
715 | error_msg_and_die("bad inode size\n"); | 715 | error_msg_and_die("bad inode size"); |
716 | #ifdef BB_FEATURE_MINIX2 | 716 | #ifdef BB_FEATURE_MINIX2 |
717 | if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) | 717 | if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) |
718 | error_msg_and_die("bad inode size\n"); | 718 | error_msg_and_die("bad inode size"); |
719 | #endif | 719 | #endif |
720 | 720 | ||
721 | /* Parse options */ | 721 | /* Parse options */ |
@@ -781,7 +781,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
781 | #ifdef BB_FEATURE_MINIX2 | 781 | #ifdef BB_FEATURE_MINIX2 |
782 | version2 = 1; | 782 | version2 = 1; |
783 | #else | 783 | #else |
784 | error_msg("%s: not compiled with minix v2 support\n", | 784 | error_msg("%s: not compiled with minix v2 support", |
785 | device_name); | 785 | device_name); |
786 | exit(-1); | 786 | exit(-1); |
787 | #endif | 787 | #endif |
@@ -832,13 +832,13 @@ goodbye: | |||
832 | strcpy(tmp + 2, ".badblocks"); | 832 | strcpy(tmp + 2, ".badblocks"); |
833 | DEV = open(device_name, O_RDWR); | 833 | DEV = open(device_name, O_RDWR); |
834 | if (DEV < 0) | 834 | if (DEV < 0) |
835 | error_msg_and_die("unable to open %s\n", device_name); | 835 | error_msg_and_die("unable to open %s", device_name); |
836 | if (fstat(DEV, &statbuf) < 0) | 836 | if (fstat(DEV, &statbuf) < 0) |
837 | error_msg_and_die("unable to stat %s\n", device_name); | 837 | error_msg_and_die("unable to stat %s", device_name); |
838 | if (!S_ISBLK(statbuf.st_mode)) | 838 | if (!S_ISBLK(statbuf.st_mode)) |
839 | check = 0; | 839 | check = 0; |
840 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) | 840 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) |
841 | error_msg_and_die("will not try to make filesystem on '%s'\n", device_name); | 841 | error_msg_and_die("will not try to make filesystem on '%s'", device_name); |
842 | setup_tables(); | 842 | setup_tables(); |
843 | if (check) | 843 | if (check) |
844 | check_blocks(); | 844 | check_blocks(); |
@@ -87,7 +87,7 @@ static void init_signature_page() | |||
87 | 87 | ||
88 | #ifdef PAGE_SIZE | 88 | #ifdef PAGE_SIZE |
89 | if (pagesize != PAGE_SIZE) | 89 | if (pagesize != PAGE_SIZE) |
90 | error_msg("Assuming pages of size %d\n", pagesize); | 90 | error_msg("Assuming pages of size %d", pagesize); |
91 | #endif | 91 | #endif |
92 | signature_page = (int *) xmalloc(pagesize); | 92 | signature_page = (int *) xmalloc(pagesize); |
93 | memset(signature_page, 0, pagesize); | 93 | memset(signature_page, 0, pagesize); |
@@ -185,7 +185,7 @@ static void page_bad(int page) | |||
185 | bit_test_and_clear(signature_page, page); | 185 | bit_test_and_clear(signature_page, page); |
186 | else { | 186 | else { |
187 | if (badpages == MAX_BADPAGES) | 187 | if (badpages == MAX_BADPAGES) |
188 | error_msg_and_die("too many bad pages\n"); | 188 | error_msg_and_die("too many bad pages"); |
189 | p->badpages[badpages] = page; | 189 | p->badpages[badpages] = page; |
190 | } | 190 | } |
191 | badpages++; | 191 | badpages++; |
@@ -206,7 +206,7 @@ static void check_blocks(void) | |||
206 | } | 206 | } |
207 | if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) != | 207 | if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) != |
208 | current_page * pagesize) | 208 | current_page * pagesize) |
209 | error_msg_and_die("seek failed in check_blocks\n"); | 209 | error_msg_and_die("seek failed in check_blocks"); |
210 | if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) { | 210 | if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) { |
211 | page_bad(current_page++); | 211 | page_bad(current_page++); |
212 | continue; | 212 | continue; |
@@ -307,14 +307,14 @@ int mkswap_main(int argc, char **argv) | |||
307 | } | 307 | } |
308 | } | 308 | } |
309 | if (!device_name) { | 309 | if (!device_name) { |
310 | error_msg("error: Nowhere to set up swap on?\n"); | 310 | error_msg("error: Nowhere to set up swap on?"); |
311 | usage(mkswap_usage); | 311 | usage(mkswap_usage); |
312 | } | 312 | } |
313 | sz = get_size(device_name); | 313 | sz = get_size(device_name); |
314 | if (!PAGES) { | 314 | if (!PAGES) { |
315 | PAGES = sz; | 315 | PAGES = sz; |
316 | } else if (PAGES > sz && !force) { | 316 | } else if (PAGES > sz && !force) { |
317 | error_msg("error: size %ld is larger than device size %d\n", | 317 | error_msg("error: size %ld is larger than device size %d", |
318 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); | 318 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); |
319 | return EXIT_FAILURE; | 319 | return EXIT_FAILURE; |
320 | } | 320 | } |
@@ -330,11 +330,11 @@ int mkswap_main(int argc, char **argv) | |||
330 | version = 1; | 330 | version = 1; |
331 | } | 331 | } |
332 | if (version != 0 && version != 1) { | 332 | if (version != 0 && version != 1) { |
333 | error_msg("error: unknown version %d\n", version); | 333 | error_msg("error: unknown version %d", version); |
334 | usage(mkswap_usage); | 334 | usage(mkswap_usage); |
335 | } | 335 | } |
336 | if (PAGES < 10) { | 336 | if (PAGES < 10) { |
337 | error_msg("error: swap area needs to be at least %ldkB\n", | 337 | error_msg("error: swap area needs to be at least %ldkB", |
338 | (long) (10 * pagesize / 1024)); | 338 | (long) (10 * pagesize / 1024)); |
339 | usage(mkswap_usage); | 339 | usage(mkswap_usage); |
340 | } | 340 | } |
@@ -353,7 +353,7 @@ int mkswap_main(int argc, char **argv) | |||
353 | #endif | 353 | #endif |
354 | if (PAGES > maxpages) { | 354 | if (PAGES > maxpages) { |
355 | PAGES = maxpages; | 355 | PAGES = maxpages; |
356 | error_msg("warning: truncating swap area to %ldkB\n", | 356 | error_msg("warning: truncating swap area to %ldkB", |
357 | PAGES * pagesize / 1024); | 357 | PAGES * pagesize / 1024); |
358 | } | 358 | } |
359 | 359 | ||
@@ -363,7 +363,7 @@ int mkswap_main(int argc, char **argv) | |||
363 | if (!S_ISBLK(statbuf.st_mode)) | 363 | if (!S_ISBLK(statbuf.st_mode)) |
364 | check = 0; | 364 | check = 0; |
365 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) | 365 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) |
366 | error_msg_and_die("Will not try to make swapdevice on '%s'\n", device_name); | 366 | error_msg_and_die("Will not try to make swapdevice on '%s'", device_name); |
367 | 367 | ||
368 | #ifdef __sparc__ | 368 | #ifdef __sparc__ |
369 | if (!force && version == 0) { | 369 | if (!force && version == 0) { |
@@ -372,7 +372,7 @@ int mkswap_main(int argc, char **argv) | |||
372 | unsigned short *q, sum; | 372 | unsigned short *q, sum; |
373 | 373 | ||
374 | if (read(DEV, buffer, 512) != 512) | 374 | if (read(DEV, buffer, 512) != 512) |
375 | error_msg_and_die("fatal: first page unreadable\n"); | 375 | error_msg_and_die("fatal: first page unreadable"); |
376 | if (buffer[508] == 0xDA && buffer[509] == 0xBE) { | 376 | if (buffer[508] == 0xDA && buffer[509] == 0xBE) { |
377 | q = (unsigned short *) (buffer + 510); | 377 | q = (unsigned short *) (buffer + 510); |
378 | for (sum = 0; q >= (unsigned short *) buffer;) | 378 | for (sum = 0; q >= (unsigned short *) buffer;) |
@@ -381,7 +381,7 @@ int mkswap_main(int argc, char **argv) | |||
381 | error_msg("Device '%s' contains a valid Sun disklabel.\n" | 381 | error_msg("Device '%s' contains a valid Sun disklabel.\n" |
382 | "This probably means creating v0 swap would destroy your partition table\n" | 382 | "This probably means creating v0 swap would destroy your partition table\n" |
383 | "No swap created. If you really want to create swap v0 on that device, use\n" | 383 | "No swap created. If you really want to create swap v0 on that device, use\n" |
384 | "the -f option to force it.\n", device_name); | 384 | "the -f option to force it.", device_name); |
385 | return EXIT_FAILURE; | 385 | return EXIT_FAILURE; |
386 | } | 386 | } |
387 | } | 387 | } |
@@ -391,7 +391,7 @@ int mkswap_main(int argc, char **argv) | |||
391 | if (version == 0 || check) | 391 | if (version == 0 || check) |
392 | check_blocks(); | 392 | check_blocks(); |
393 | if (version == 0 && !bit_test_and_clear(signature_page, 0)) | 393 | if (version == 0 && !bit_test_and_clear(signature_page, 0)) |
394 | error_msg_and_die("fatal: first page unreadable\n"); | 394 | error_msg_and_die("fatal: first page unreadable"); |
395 | if (version == 1) { | 395 | if (version == 1) { |
396 | p->version = version; | 396 | p->version = version; |
397 | p->last_page = PAGES - 1; | 397 | p->last_page = PAGES - 1; |
@@ -400,23 +400,23 @@ int mkswap_main(int argc, char **argv) | |||
400 | 400 | ||
401 | goodpages = PAGES - badpages - 1; | 401 | goodpages = PAGES - badpages - 1; |
402 | if (goodpages <= 0) | 402 | if (goodpages <= 0) |
403 | error_msg_and_die("Unable to set up swap-space: unreadable\n"); | 403 | error_msg_and_die("Unable to set up swap-space: unreadable"); |
404 | printf("Setting up swapspace version %d, size = %ld bytes\n", | 404 | printf("Setting up swapspace version %d, size = %ld bytes\n", |
405 | version, (long) (goodpages * pagesize)); | 405 | version, (long) (goodpages * pagesize)); |
406 | write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2"); | 406 | write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2"); |
407 | 407 | ||
408 | offset = ((version == 0) ? 0 : 1024); | 408 | offset = ((version == 0) ? 0 : 1024); |
409 | if (lseek(DEV, offset, SEEK_SET) != offset) | 409 | if (lseek(DEV, offset, SEEK_SET) != offset) |
410 | error_msg_and_die("unable to rewind swap-device\n"); | 410 | error_msg_and_die("unable to rewind swap-device"); |
411 | if (write(DEV, (char *) signature_page + offset, pagesize - offset) | 411 | if (write(DEV, (char *) signature_page + offset, pagesize - offset) |
412 | != pagesize - offset) | 412 | != pagesize - offset) |
413 | error_msg_and_die("unable to write signature page\n"); | 413 | error_msg_and_die("unable to write signature page"); |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * A subsequent swapon() will fail if the signature | 416 | * A subsequent swapon() will fail if the signature |
417 | * is not actually on disk. (This is a kernel bug.) | 417 | * is not actually on disk. (This is a kernel bug.) |
418 | */ | 418 | */ |
419 | if (fsync(DEV)) | 419 | if (fsync(DEV)) |
420 | error_msg_and_die("fsync failed\n"); | 420 | error_msg_and_die("fsync failed"); |
421 | return EXIT_SUCCESS; | 421 | return EXIT_SUCCESS; |
422 | } | 422 | } |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 57a152c01..e55d9fafb 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -81,7 +81,7 @@ | |||
81 | #ifndef MODUTILS_MODULE_H | 81 | #ifndef MODUTILS_MODULE_H |
82 | static const int MODUTILS_MODULE_H = 1; | 82 | static const int MODUTILS_MODULE_H = 1; |
83 | 83 | ||
84 | #ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $" | 84 | #ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" |
85 | 85 | ||
86 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 86 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
87 | We do not use the kernel headers directly because we do not wish | 87 | We do not use the kernel headers directly because we do not wish |
@@ -287,7 +287,7 @@ int delete_module(const char *); | |||
287 | #ifndef MODUTILS_OBJ_H | 287 | #ifndef MODUTILS_OBJ_H |
288 | static const int MODUTILS_OBJ_H = 1; | 288 | static const int MODUTILS_OBJ_H = 1; |
289 | 289 | ||
290 | #ident "$Id: insmod.c,v 1.44 2001/01/27 09:33:38 andersen Exp $" | 290 | #ident "$Id: insmod.c,v 1.45 2001/01/31 19:00:21 kraai Exp $" |
291 | 291 | ||
292 | /* The relocatable object is manipulated using elfin types. */ | 292 | /* The relocatable object is manipulated using elfin types. */ |
293 | 293 | ||
@@ -1156,7 +1156,7 @@ struct obj_symbol *obj_add_symbol(struct obj_file *f, const char *name, | |||
1156 | /* Don't report an error if the symbol is coming from | 1156 | /* Don't report an error if the symbol is coming from |
1157 | the kernel or some external module. */ | 1157 | the kernel or some external module. */ |
1158 | if (secidx <= SHN_HIRESERVE) | 1158 | if (secidx <= SHN_HIRESERVE) |
1159 | error_msg("%s multiply defined\n", name); | 1159 | error_msg("%s multiply defined", name); |
1160 | return sym; | 1160 | return sym; |
1161 | } | 1161 | } |
1162 | } | 1162 | } |
@@ -1419,7 +1419,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1419 | 1419 | ||
1420 | /* Also check that the parameter was not resolved from the kernel. */ | 1420 | /* Also check that the parameter was not resolved from the kernel. */ |
1421 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { | 1421 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { |
1422 | error_msg("symbol for parameter %s not found\n", p); | 1422 | error_msg("symbol for parameter %s not found", p); |
1423 | return 0; | 1423 | return 0; |
1424 | } | 1424 | } |
1425 | 1425 | ||
@@ -1432,7 +1432,7 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1432 | str = alloca(strlen(q)); | 1432 | str = alloca(strlen(q)); |
1433 | for (r = str, q++; *q != '"'; ++q, ++r) { | 1433 | for (r = str, q++; *q != '"'; ++q, ++r) { |
1434 | if (*q == '\0') { | 1434 | if (*q == '\0') { |
1435 | error_msg("improperly terminated string argument for %s\n", p); | 1435 | error_msg("improperly terminated string argument for %s", p); |
1436 | return 0; | 1436 | return 0; |
1437 | } else if (*q == '\\') | 1437 | } else if (*q == '\\') |
1438 | switch (*++q) { | 1438 | switch (*++q) { |
@@ -1786,7 +1786,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1786 | p = get_modinfo_value(f, key); | 1786 | p = get_modinfo_value(f, key); |
1787 | key += 5; | 1787 | key += 5; |
1788 | if (p == NULL) { | 1788 | if (p == NULL) { |
1789 | error_msg("invalid parameter %s\n", key); | 1789 | error_msg("invalid parameter %s", key); |
1790 | return 0; | 1790 | return 0; |
1791 | } | 1791 | } |
1792 | 1792 | ||
@@ -1794,7 +1794,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1794 | 1794 | ||
1795 | /* Also check that the parameter was not resolved from the kernel. */ | 1795 | /* Also check that the parameter was not resolved from the kernel. */ |
1796 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { | 1796 | if (sym == NULL || sym->secidx > SHN_HIRESERVE) { |
1797 | error_msg("symbol for parameter %s not found\n", key); | 1797 | error_msg("symbol for parameter %s not found", key); |
1798 | return 0; | 1798 | return 0; |
1799 | } | 1799 | } |
1800 | 1800 | ||
@@ -1822,7 +1822,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1822 | str = alloca(strlen(q)); | 1822 | str = alloca(strlen(q)); |
1823 | for (r = str, q++; *q != '"'; ++q, ++r) { | 1823 | for (r = str, q++; *q != '"'; ++q, ++r) { |
1824 | if (*q == '\0') { | 1824 | if (*q == '\0') { |
1825 | error_msg("improperly terminated string argument for %s\n", | 1825 | error_msg("improperly terminated string argument for %s", |
1826 | key); | 1826 | key); |
1827 | return 0; | 1827 | return 0; |
1828 | } else if (*q == '\\') | 1828 | } else if (*q == '\\') |
@@ -1917,14 +1917,14 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1917 | /* Probably we should do that outside the loop ? */ | 1917 | /* Probably we should do that outside the loop ? */ |
1918 | if (!isdigit(*(p + 1))) { | 1918 | if (!isdigit(*(p + 1))) { |
1919 | error_msg("parameter type 'c' for %s must be followed by" | 1919 | error_msg("parameter type 'c' for %s must be followed by" |
1920 | " the maximum size\n", key); | 1920 | " the maximum size", key); |
1921 | return 0; | 1921 | return 0; |
1922 | } | 1922 | } |
1923 | charssize = strtoul(p + 1, (char **) NULL, 10); | 1923 | charssize = strtoul(p + 1, (char **) NULL, 10); |
1924 | 1924 | ||
1925 | /* Check length */ | 1925 | /* Check length */ |
1926 | if (strlen(str) >= charssize) { | 1926 | if (strlen(str) >= charssize) { |
1927 | error_msg("string too long for %s (max %ld)\n", key, | 1927 | error_msg("string too long for %s (max %ld)", key, |
1928 | charssize - 1); | 1928 | charssize - 1); |
1929 | return 0; | 1929 | return 0; |
1930 | } | 1930 | } |
@@ -1953,7 +1953,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1953 | break; | 1953 | break; |
1954 | 1954 | ||
1955 | default: | 1955 | default: |
1956 | error_msg("unknown parameter type '%c' for %s\n", *p, key); | 1956 | error_msg("unknown parameter type '%c' for %s", *p, key); |
1957 | return 0; | 1957 | return 0; |
1958 | } | 1958 | } |
1959 | } | 1959 | } |
@@ -1972,21 +1972,21 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
1972 | 1972 | ||
1973 | case ',': | 1973 | case ',': |
1974 | if (++n > max) { | 1974 | if (++n > max) { |
1975 | error_msg("too many values for %s (max %d)\n", key, max); | 1975 | error_msg("too many values for %s (max %d)", key, max); |
1976 | return 0; | 1976 | return 0; |
1977 | } | 1977 | } |
1978 | ++q; | 1978 | ++q; |
1979 | break; | 1979 | break; |
1980 | 1980 | ||
1981 | default: | 1981 | default: |
1982 | error_msg("invalid argument syntax for %s\n", key); | 1982 | error_msg("invalid argument syntax for %s", key); |
1983 | return 0; | 1983 | return 0; |
1984 | } | 1984 | } |
1985 | } | 1985 | } |
1986 | 1986 | ||
1987 | end_of_arg: | 1987 | end_of_arg: |
1988 | if (n < min) { | 1988 | if (n < min) { |
1989 | error_msg("too few values for %s (min %d)\n", key, min); | 1989 | error_msg("too few values for %s (min %d)", key, min); |
1990 | return 0; | 1990 | return 0; |
1991 | } | 1991 | } |
1992 | 1992 | ||
@@ -2372,7 +2372,7 @@ int obj_check_undefineds(struct obj_file *f) | |||
2372 | sym->secidx = SHN_ABS; | 2372 | sym->secidx = SHN_ABS; |
2373 | sym->value = 0; | 2373 | sym->value = 0; |
2374 | } else { | 2374 | } else { |
2375 | error_msg("unresolved symbol %s\n", sym->name); | 2375 | error_msg("unresolved symbol %s", sym->name); |
2376 | ret = 0; | 2376 | ret = 0; |
2377 | } | 2377 | } |
2378 | } | 2378 | } |
@@ -2599,11 +2599,11 @@ int obj_relocate(struct obj_file *f, ElfW(Addr) base) | |||
2599 | errmsg = "Unhandled relocation"; | 2599 | errmsg = "Unhandled relocation"; |
2600 | bad_reloc: | 2600 | bad_reloc: |
2601 | if (extsym) { | 2601 | if (extsym) { |
2602 | error_msg("%s of type %ld for %s\n", errmsg, | 2602 | error_msg("%s of type %ld for %s", errmsg, |
2603 | (long) ELFW(R_TYPE) (rel->r_info), | 2603 | (long) ELFW(R_TYPE) (rel->r_info), |
2604 | strtab + extsym->st_name); | 2604 | strtab + extsym->st_name); |
2605 | } else { | 2605 | } else { |
2606 | error_msg("%s of type %ld\n", errmsg, | 2606 | error_msg("%s of type %ld", errmsg, |
2607 | (long) ELFW(R_TYPE) (rel->r_info)); | 2607 | (long) ELFW(R_TYPE) (rel->r_info)); |
2608 | } | 2608 | } |
2609 | ret = 0; | 2609 | ret = 0; |
@@ -2688,25 +2688,25 @@ struct obj_file *obj_load(FILE * fp) | |||
2688 | || f->header.e_ident[EI_MAG1] != ELFMAG1 | 2688 | || f->header.e_ident[EI_MAG1] != ELFMAG1 |
2689 | || f->header.e_ident[EI_MAG2] != ELFMAG2 | 2689 | || f->header.e_ident[EI_MAG2] != ELFMAG2 |
2690 | || f->header.e_ident[EI_MAG3] != ELFMAG3) { | 2690 | || f->header.e_ident[EI_MAG3] != ELFMAG3) { |
2691 | error_msg("not an ELF file\n"); | 2691 | error_msg("not an ELF file"); |
2692 | return NULL; | 2692 | return NULL; |
2693 | } | 2693 | } |
2694 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM | 2694 | if (f->header.e_ident[EI_CLASS] != ELFCLASSM |
2695 | || f->header.e_ident[EI_DATA] != ELFDATAM | 2695 | || f->header.e_ident[EI_DATA] != ELFDATAM |
2696 | || f->header.e_ident[EI_VERSION] != EV_CURRENT | 2696 | || f->header.e_ident[EI_VERSION] != EV_CURRENT |
2697 | || !MATCH_MACHINE(f->header.e_machine)) { | 2697 | || !MATCH_MACHINE(f->header.e_machine)) { |
2698 | error_msg("ELF file not for this architecture\n"); | 2698 | error_msg("ELF file not for this architecture"); |
2699 | return NULL; | 2699 | return NULL; |
2700 | } | 2700 | } |
2701 | if (f->header.e_type != ET_REL) { | 2701 | if (f->header.e_type != ET_REL) { |
2702 | error_msg("ELF file not a relocatable object\n"); | 2702 | error_msg("ELF file not a relocatable object"); |
2703 | return NULL; | 2703 | return NULL; |
2704 | } | 2704 | } |
2705 | 2705 | ||
2706 | /* Read the section headers. */ | 2706 | /* Read the section headers. */ |
2707 | 2707 | ||
2708 | if (f->header.e_shentsize != sizeof(ElfW(Shdr))) { | 2708 | if (f->header.e_shentsize != sizeof(ElfW(Shdr))) { |
2709 | error_msg("section header size mismatch: %lu != %lu\n", | 2709 | error_msg("section header size mismatch: %lu != %lu", |
2710 | (unsigned long) f->header.e_shentsize, | 2710 | (unsigned long) f->header.e_shentsize, |
2711 | (unsigned long) sizeof(ElfW(Shdr))); | 2711 | (unsigned long) sizeof(ElfW(Shdr))); |
2712 | return NULL; | 2712 | return NULL; |
@@ -2759,11 +2759,11 @@ struct obj_file *obj_load(FILE * fp) | |||
2759 | 2759 | ||
2760 | #if SHT_RELM == SHT_REL | 2760 | #if SHT_RELM == SHT_REL |
2761 | case SHT_RELA: | 2761 | case SHT_RELA: |
2762 | error_msg("RELA relocations not supported on this architecture\n"); | 2762 | error_msg("RELA relocations not supported on this architecture"); |
2763 | return NULL; | 2763 | return NULL; |
2764 | #else | 2764 | #else |
2765 | case SHT_REL: | 2765 | case SHT_REL: |
2766 | error_msg("REL relocations not supported on this architecture\n"); | 2766 | error_msg("REL relocations not supported on this architecture"); |
2767 | return NULL; | 2767 | return NULL; |
2768 | #endif | 2768 | #endif |
2769 | 2769 | ||
@@ -2776,7 +2776,7 @@ struct obj_file *obj_load(FILE * fp) | |||
2776 | break; | 2776 | break; |
2777 | } | 2777 | } |
2778 | 2778 | ||
2779 | error_msg("can't handle sections of type %ld\n", | 2779 | error_msg("can't handle sections of type %ld", |
2780 | (long) sec->header.sh_type); | 2780 | (long) sec->header.sh_type); |
2781 | return NULL; | 2781 | return NULL; |
2782 | } | 2782 | } |
@@ -2805,7 +2805,7 @@ struct obj_file *obj_load(FILE * fp) | |||
2805 | ElfW(Sym) * sym; | 2805 | ElfW(Sym) * sym; |
2806 | 2806 | ||
2807 | if (sec->header.sh_entsize != sizeof(ElfW(Sym))) { | 2807 | if (sec->header.sh_entsize != sizeof(ElfW(Sym))) { |
2808 | error_msg("symbol size mismatch: %lu != %lu\n", | 2808 | error_msg("symbol size mismatch: %lu != %lu", |
2809 | (unsigned long) sec->header.sh_entsize, | 2809 | (unsigned long) sec->header.sh_entsize, |
2810 | (unsigned long) sizeof(ElfW(Sym))); | 2810 | (unsigned long) sizeof(ElfW(Sym))); |
2811 | return NULL; | 2811 | return NULL; |
@@ -2837,7 +2837,7 @@ struct obj_file *obj_load(FILE * fp) | |||
2837 | 2837 | ||
2838 | case SHT_RELM: | 2838 | case SHT_RELM: |
2839 | if (sec->header.sh_entsize != sizeof(ElfW(RelM))) { | 2839 | if (sec->header.sh_entsize != sizeof(ElfW(RelM))) { |
2840 | error_msg("relocation entry size mismatch: %lu != %lu\n", | 2840 | error_msg("relocation entry size mismatch: %lu != %lu", |
2841 | (unsigned long) sec->header.sh_entsize, | 2841 | (unsigned long) sec->header.sh_entsize, |
2842 | (unsigned long) sizeof(ElfW(RelM))); | 2842 | (unsigned long) sizeof(ElfW(RelM))); |
2843 | return NULL; | 2843 | return NULL; |
@@ -2949,11 +2949,11 @@ extern int insmod_main( int argc, char **argv) | |||
2949 | if (m_filename[0] == '\0' | 2949 | if (m_filename[0] == '\0' |
2950 | || ((fp = fopen(m_filename, "r")) == NULL)) | 2950 | || ((fp = fopen(m_filename, "r")) == NULL)) |
2951 | { | 2951 | { |
2952 | error_msg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2952 | error_msg("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES); |
2953 | return EXIT_FAILURE; | 2953 | return EXIT_FAILURE; |
2954 | } | 2954 | } |
2955 | } else | 2955 | } else |
2956 | error_msg_and_die("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2956 | error_msg_and_die("No module named '%s' found in '%s'", m_fullName, _PATH_MODULES); |
2957 | } else | 2957 | } else |
2958 | memcpy(m_filename, argv[optind], strlen(argv[optind])); | 2958 | memcpy(m_filename, argv[optind], strlen(argv[optind])); |
2959 | 2959 | ||
@@ -2976,7 +2976,7 @@ extern int insmod_main( int argc, char **argv) | |||
2976 | m_version = old_get_module_version(f, m_strversion); | 2976 | m_version = old_get_module_version(f, m_strversion); |
2977 | if (m_version == -1) { | 2977 | if (m_version == -1) { |
2978 | error_msg("couldn't find the kernel version the module was " | 2978 | error_msg("couldn't find the kernel version the module was " |
2979 | "compiled for\n"); | 2979 | "compiled for"); |
2980 | goto out; | 2980 | goto out; |
2981 | } | 2981 | } |
2982 | } | 2982 | } |
@@ -2985,12 +2985,12 @@ extern int insmod_main( int argc, char **argv) | |||
2985 | if (flag_force_load) { | 2985 | if (flag_force_load) { |
2986 | error_msg("Warning: kernel-module version mismatch\n" | 2986 | error_msg("Warning: kernel-module version mismatch\n" |
2987 | "\t%s was compiled for kernel version %s\n" | 2987 | "\t%s was compiled for kernel version %s\n" |
2988 | "\twhile this kernel is version %s\n", | 2988 | "\twhile this kernel is version %s", |
2989 | m_filename, m_strversion, k_strversion); | 2989 | m_filename, m_strversion, k_strversion); |
2990 | } else { | 2990 | } else { |
2991 | error_msg("kernel-module version mismatch\n" | 2991 | error_msg("kernel-module version mismatch\n" |
2992 | "\t%s was compiled for kernel version %s\n" | 2992 | "\t%s was compiled for kernel version %s\n" |
2993 | "\twhile this kernel is version %s.\n", | 2993 | "\twhile this kernel is version %s.", |
2994 | m_filename, m_strversion, k_strversion); | 2994 | m_filename, m_strversion, k_strversion); |
2995 | goto out; | 2995 | goto out; |
2996 | } | 2996 | } |
@@ -3006,7 +3006,7 @@ extern int insmod_main( int argc, char **argv) | |||
3006 | goto out; | 3006 | goto out; |
3007 | k_crcs = new_is_kernel_checksummed(); | 3007 | k_crcs = new_is_kernel_checksummed(); |
3008 | #else | 3008 | #else |
3009 | error_msg("Not configured to support new kernels\n"); | 3009 | error_msg("Not configured to support new kernels"); |
3010 | goto out; | 3010 | goto out; |
3011 | #endif | 3011 | #endif |
3012 | } else { | 3012 | } else { |
@@ -3015,7 +3015,7 @@ extern int insmod_main( int argc, char **argv) | |||
3015 | goto out; | 3015 | goto out; |
3016 | k_crcs = old_is_kernel_checksummed(); | 3016 | k_crcs = old_is_kernel_checksummed(); |
3017 | #else | 3017 | #else |
3018 | error_msg("Not configured to support old kernels\n"); | 3018 | error_msg("Not configured to support old kernels"); |
3019 | goto out; | 3019 | goto out; |
3020 | #endif | 3020 | #endif |
3021 | } | 3021 | } |
@@ -3072,10 +3072,10 @@ extern int insmod_main( int argc, char **argv) | |||
3072 | m_addr = create_module(m_name, m_size); | 3072 | m_addr = create_module(m_name, m_size); |
3073 | if (m_addr==-1) switch (errno) { | 3073 | if (m_addr==-1) switch (errno) { |
3074 | case EEXIST: | 3074 | case EEXIST: |
3075 | error_msg("A module named %s already exists\n", m_name); | 3075 | error_msg("A module named %s already exists", m_name); |
3076 | goto out; | 3076 | goto out; |
3077 | case ENOMEM: | 3077 | case ENOMEM: |
3078 | error_msg("Can't allocate kernel memory for module; needed %lu bytes\n", | 3078 | error_msg("Can't allocate kernel memory for module; needed %lu bytes", |
3079 | m_size); | 3079 | m_size); |
3080 | goto out; | 3080 | goto out; |
3081 | default: | 3081 | default: |
@@ -132,20 +132,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, | |||
132 | 132 | ||
133 | specialfile = find_unused_loop_device(); | 133 | specialfile = find_unused_loop_device(); |
134 | if (specialfile == NULL) { | 134 | if (specialfile == NULL) { |
135 | error_msg_and_die("Could not find a spare loop device\n"); | 135 | error_msg_and_die("Could not find a spare loop device"); |
136 | } | 136 | } |
137 | if (set_loop(specialfile, lofile, 0, &loro)) { | 137 | if (set_loop(specialfile, lofile, 0, &loro)) { |
138 | error_msg_and_die("Could not setup loop device\n"); | 138 | error_msg_and_die("Could not setup loop device"); |
139 | } | 139 | } |
140 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ | 140 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ |
141 | error_msg("WARNING: loop device is read-only\n"); | 141 | error_msg("WARNING: loop device is read-only"); |
142 | flags &= ~MS_RDONLY; | 142 | flags &= ~MS_RDONLY; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | #endif | 145 | #endif |
146 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); | 146 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); |
147 | if (errno == EROFS) { | 147 | if (errno == EROFS) { |
148 | error_msg("%s is write-protected, mounting read-only\n", specialfile); | 148 | error_msg("%s is write-protected, mounting read-only", specialfile); |
149 | status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags); | 149 | status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags); |
150 | } | 150 | } |
151 | } | 151 | } |
@@ -171,7 +171,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, | |||
171 | #endif | 171 | #endif |
172 | 172 | ||
173 | if (errno == EPERM) { | 173 | if (errno == EPERM) { |
174 | error_msg_and_die("permission denied. Are you root?\n"); | 174 | error_msg_and_die("permission denied. Are you root?"); |
175 | } | 175 | } |
176 | 176 | ||
177 | return (FALSE); | 177 | return (FALSE); |
@@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | if (code->name == 0) { | 78 | if (code->name == 0) { |
79 | error_msg("unrecognized opcode %s.\n", argv[1]); | 79 | error_msg("unrecognized opcode %s.", argv[1]); |
80 | return EXIT_FAILURE; | 80 | return EXIT_FAILURE; |
81 | } | 81 | } |
82 | 82 | ||
@@ -59,7 +59,7 @@ int nc_main(int argc, char **argv) | |||
59 | perror_msg_and_die("socket"); | 59 | perror_msg_and_die("socket"); |
60 | 60 | ||
61 | if ((hostinfo = gethostbyname(*argv)) == NULL) | 61 | if ((hostinfo = gethostbyname(*argv)) == NULL) |
62 | error_msg_and_die("cannot resolve %s\n", *argv); | 62 | error_msg_and_die("cannot resolve %s", *argv); |
63 | 63 | ||
64 | address.sin_family = AF_INET; | 64 | address.sin_family = AF_INET; |
65 | address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; | 65 | address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; |
diff --git a/networking/hostname.c b/networking/hostname.c index a789fa0f1..3dba64154 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $ | 3 | * $Id: hostname.c,v 1.22 2001/01/31 19:00:20 kraai Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -41,7 +41,7 @@ void do_sethostname(char *s, int isfile) | |||
41 | if (!isfile) { | 41 | if (!isfile) { |
42 | if (sethostname(s, strlen(s)) < 0) { | 42 | if (sethostname(s, strlen(s)) < 0) { |
43 | if (errno == EPERM) | 43 | if (errno == EPERM) |
44 | error_msg_and_die("you must be root to change the hostname\n"); | 44 | error_msg_and_die("you must be root to change the hostname"); |
45 | else | 45 | else |
46 | perror_msg_and_die("sethostname"); | 46 | perror_msg_and_die("sethostname"); |
47 | } | 47 | } |
diff --git a/networking/nc.c b/networking/nc.c index 7de4015ac..682da82bf 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -59,7 +59,7 @@ int nc_main(int argc, char **argv) | |||
59 | perror_msg_and_die("socket"); | 59 | perror_msg_and_die("socket"); |
60 | 60 | ||
61 | if ((hostinfo = gethostbyname(*argv)) == NULL) | 61 | if ((hostinfo = gethostbyname(*argv)) == NULL) |
62 | error_msg_and_die("cannot resolve %s\n", *argv); | 62 | error_msg_and_die("cannot resolve %s", *argv); |
63 | 63 | ||
64 | address.sin_family = AF_INET; | 64 | address.sin_family = AF_INET; |
65 | address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; | 65 | address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; |
diff --git a/networking/ping.c b/networking/ping.c index a2e916362..15611babd 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ | 3 | * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -203,7 +203,7 @@ static void ping(const char *host) | |||
203 | 203 | ||
204 | pingaddr.sin_family = AF_INET; | 204 | pingaddr.sin_family = AF_INET; |
205 | if (!(h = gethostbyname(host))) { | 205 | if (!(h = gethostbyname(host))) { |
206 | error_msg("unknown host %s\n", host); | 206 | error_msg("unknown host %s", host); |
207 | exit(1); | 207 | exit(1); |
208 | } | 208 | } |
209 | memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr)); | 209 | memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr)); |
@@ -324,7 +324,7 @@ static void sendping(int junk) | |||
324 | if (i < 0) | 324 | if (i < 0) |
325 | perror_msg_and_die("sendto"); | 325 | perror_msg_and_die("sendto"); |
326 | else if ((size_t)i != sizeof(packet)) | 326 | else if ((size_t)i != sizeof(packet)) |
327 | error_msg_and_die("ping wrote %d chars; %d expected\n", i, | 327 | error_msg_and_die("ping wrote %d chars; %d expected", i, |
328 | (int)sizeof(packet)); | 328 | (int)sizeof(packet)); |
329 | 329 | ||
330 | signal(SIGALRM, sendping); | 330 | signal(SIGALRM, sendping); |
@@ -419,7 +419,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from) | |||
419 | printf("\n"); | 419 | printf("\n"); |
420 | } else | 420 | } else |
421 | if (icmppkt->icmp_type != ICMP_ECHO) | 421 | if (icmppkt->icmp_type != ICMP_ECHO) |
422 | error_msg("Warning: Got ICMP %d (%s)\n", | 422 | error_msg("Warning: Got ICMP %d (%s)", |
423 | icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); | 423 | icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); |
424 | } | 424 | } |
425 | 425 | ||
@@ -437,7 +437,7 @@ static void ping(const char *host) | |||
437 | if ((pingsock = socket(AF_INET, SOCK_RAW, | 437 | if ((pingsock = socket(AF_INET, SOCK_RAW, |
438 | (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */ | 438 | (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */ |
439 | if (errno == EPERM) | 439 | if (errno == EPERM) |
440 | error_msg_and_die("permission denied. (are you root?)\n"); | 440 | error_msg_and_die("permission denied. (are you root?)"); |
441 | else | 441 | else |
442 | perror_msg_and_die("creating a raw socket"); | 442 | perror_msg_and_die("creating a raw socket"); |
443 | } | 443 | } |
@@ -449,12 +449,12 @@ static void ping(const char *host) | |||
449 | 449 | ||
450 | pingaddr.sin_family = AF_INET; | 450 | pingaddr.sin_family = AF_INET; |
451 | if (!(h = gethostbyname(host))) { | 451 | if (!(h = gethostbyname(host))) { |
452 | error_msg("unknown host %s\n", host); | 452 | error_msg("unknown host %s", host); |
453 | exit(1); | 453 | exit(1); |
454 | } | 454 | } |
455 | 455 | ||
456 | if (h->h_addrtype != AF_INET) { | 456 | if (h->h_addrtype != AF_INET) { |
457 | error_msg("unknown address type; only AF_INET is currently supported.\n"); | 457 | error_msg("unknown address type; only AF_INET is currently supported."); |
458 | exit(1); | 458 | exit(1); |
459 | } | 459 | } |
460 | 460 | ||
diff --git a/networking/telnet.c b/networking/telnet.c index 8f7bbf29b..b08effed7 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -584,7 +584,7 @@ static int getport(char * p) | |||
584 | 584 | ||
585 | if ((unsigned)(port - 1 ) > 65534) | 585 | if ((unsigned)(port - 1 ) > 65534) |
586 | { | 586 | { |
587 | error_msg_and_die("%s: bad port number\n", p); | 587 | error_msg_and_die("%s: bad port number", p); |
588 | } | 588 | } |
589 | return port; | 589 | return port; |
590 | } | 590 | } |
@@ -596,7 +596,7 @@ static struct in_addr getserver(char * host) | |||
596 | struct hostent * he; | 596 | struct hostent * he; |
597 | if ((he = gethostbyname(host)) == NULL) | 597 | if ((he = gethostbyname(host)) == NULL) |
598 | { | 598 | { |
599 | error_msg_and_die("%s: Unknown host\n", host); | 599 | error_msg_and_die("%s: Unknown host", host); |
600 | } | 600 | } |
601 | memcpy(&addr, he->h_addr, sizeof addr); | 601 | memcpy(&addr, he->h_addr, sizeof addr); |
602 | 602 | ||
diff --git a/networking/wget.c b/networking/wget.c index 729c6fdc7..70f8d1b89 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -148,7 +148,7 @@ int wget_main(int argc, char **argv) | |||
148 | #endif | 148 | #endif |
149 | } | 149 | } |
150 | if (do_continue && !fname_out) | 150 | if (do_continue && !fname_out) |
151 | error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n"); | 151 | error_msg_and_die("cannot specify continue (-c) without a filename (-O)"); |
152 | 152 | ||
153 | 153 | ||
154 | /* | 154 | /* |
@@ -200,7 +200,7 @@ int wget_main(int argc, char **argv) | |||
200 | */ | 200 | */ |
201 | if (fgets(buf, sizeof(buf), sfp) == NULL) { | 201 | if (fgets(buf, sizeof(buf), sfp) == NULL) { |
202 | close_and_delete_outfile(output, fname_out, do_continue); | 202 | close_and_delete_outfile(output, fname_out, do_continue); |
203 | error_msg_and_die("no response from server\n"); | 203 | error_msg_and_die("no response from server"); |
204 | } | 204 | } |
205 | for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) | 205 | for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) |
206 | ; | 206 | ; |
@@ -230,7 +230,7 @@ int wget_main(int argc, char **argv) | |||
230 | } | 230 | } |
231 | if (strcasecmp(buf, "transfer-encoding") == 0) { | 231 | if (strcasecmp(buf, "transfer-encoding") == 0) { |
232 | close_and_delete_outfile(output, fname_out, do_continue); | 232 | close_and_delete_outfile(output, fname_out, do_continue); |
233 | error_msg_and_die("server wants to do %s transfer encoding\n", s); | 233 | error_msg_and_die("server wants to do %s transfer encoding", s); |
234 | continue; | 234 | continue; |
235 | } | 235 | } |
236 | } | 236 | } |
@@ -267,7 +267,7 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path) | |||
267 | *uri_port = 80; | 267 | *uri_port = 80; |
268 | 268 | ||
269 | if (strncmp(url, "http://", 7) != 0) | 269 | if (strncmp(url, "http://", 7) != 0) |
270 | error_msg_and_die("not an http url: %s\n", url); | 270 | error_msg_and_die("not an http url: %s", url); |
271 | 271 | ||
272 | *uri_host = url + 7; | 272 | *uri_host = url + 7; |
273 | 273 | ||
@@ -297,7 +297,7 @@ FILE *open_socket(char *host, int port) | |||
297 | memset(&sin, 0, sizeof(sin)); | 297 | memset(&sin, 0, sizeof(sin)); |
298 | sin.sin_family = AF_INET; | 298 | sin.sin_family = AF_INET; |
299 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 299 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
300 | error_msg_and_die("cannot resolve %s\n", host); | 300 | error_msg_and_die("cannot resolve %s", host); |
301 | memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); | 301 | memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); |
302 | sin.sin_port = htons(port); | 302 | sin.sin_port = htons(port); |
303 | 303 | ||
@@ -338,7 +338,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc) | |||
338 | 338 | ||
339 | /* verify we are at the end of the header name */ | 339 | /* verify we are at the end of the header name */ |
340 | if (*s != ':') | 340 | if (*s != ':') |
341 | error_msg_and_die("bad header line: %s\n", buf); | 341 | error_msg_and_die("bad header line: %s", buf); |
342 | 342 | ||
343 | /* locate the start of the header value */ | 343 | /* locate the start of the header value */ |
344 | for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s) | 344 | for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s) |
@@ -532,7 +532,7 @@ progressmeter(int flag) | |||
532 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 532 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
533 | * SUCH DAMAGE. | 533 | * SUCH DAMAGE. |
534 | * | 534 | * |
535 | * $Id: wget.c,v 1.24 2001/01/31 17:49:47 andersen Exp $ | 535 | * $Id: wget.c,v 1.25 2001/01/31 19:00:21 kraai Exp $ |
536 | */ | 536 | */ |
537 | 537 | ||
538 | 538 | ||
diff --git a/nfsmount.c b/nfsmount.c index b260a885f..397858b71 100644 --- a/nfsmount.c +++ b/nfsmount.c | |||
@@ -307,7 +307,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
307 | msock = fsock = -1; | 307 | msock = fsock = -1; |
308 | mclient = NULL; | 308 | mclient = NULL; |
309 | if (strlen(spec) >= sizeof(hostdir)) { | 309 | if (strlen(spec) >= sizeof(hostdir)) { |
310 | error_msg("excessively long host:dir argument\n"); | 310 | error_msg("excessively long host:dir argument"); |
311 | goto fail; | 311 | goto fail; |
312 | } | 312 | } |
313 | strcpy(hostdir, spec); | 313 | strcpy(hostdir, spec); |
@@ -319,10 +319,10 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
319 | until they can be fully supported. (mack@sgi.com) */ | 319 | until they can be fully supported. (mack@sgi.com) */ |
320 | if ((s = strchr(hostdir, ','))) { | 320 | if ((s = strchr(hostdir, ','))) { |
321 | *s = '\0'; | 321 | *s = '\0'; |
322 | error_msg("warning: multiple hostnames not supported\n"); | 322 | error_msg("warning: multiple hostnames not supported"); |
323 | } | 323 | } |
324 | } else { | 324 | } else { |
325 | error_msg("directory to mount not in host:dir format\n"); | 325 | error_msg("directory to mount not in host:dir format"); |
326 | goto fail; | 326 | goto fail; |
327 | } | 327 | } |
328 | 328 | ||
@@ -332,11 +332,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
332 | #endif | 332 | #endif |
333 | { | 333 | { |
334 | if ((hp = gethostbyname(hostname)) == NULL) { | 334 | if ((hp = gethostbyname(hostname)) == NULL) { |
335 | error_msg("can't get address for %s\n", hostname); | 335 | error_msg("can't get address for %s", hostname); |
336 | goto fail; | 336 | goto fail; |
337 | } else { | 337 | } else { |
338 | if (hp->h_length > sizeof(struct in_addr)) { | 338 | if (hp->h_length > sizeof(struct in_addr)) { |
339 | error_msg("got bad hp->h_length\n"); | 339 | error_msg("got bad hp->h_length"); |
340 | hp->h_length = sizeof(struct in_addr); | 340 | hp->h_length = sizeof(struct in_addr); |
341 | } | 341 | } |
342 | memcpy(&server_addr.sin_addr, | 342 | memcpy(&server_addr.sin_addr, |
@@ -353,7 +353,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
353 | if (!old_opts) | 353 | if (!old_opts) |
354 | old_opts = ""; | 354 | old_opts = ""; |
355 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { | 355 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { |
356 | error_msg("excessively long option argument\n"); | 356 | error_msg("excessively long option argument"); |
357 | goto fail; | 357 | goto fail; |
358 | } | 358 | } |
359 | sprintf(new_opts, "%s%saddr=%s", | 359 | sprintf(new_opts, "%s%saddr=%s", |
@@ -513,11 +513,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
513 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); | 513 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); |
514 | #endif | 514 | #endif |
515 | if (nfsvers > MAX_NFSPROT) { | 515 | if (nfsvers > MAX_NFSPROT) { |
516 | error_msg("NFSv%d not supported!\n", nfsvers); | 516 | error_msg("NFSv%d not supported!", nfsvers); |
517 | return 0; | 517 | return 0; |
518 | } | 518 | } |
519 | if (mountvers > MAX_NFSPROT) { | 519 | if (mountvers > MAX_NFSPROT) { |
520 | error_msg("NFSv%d not supported!\n", nfsvers); | 520 | error_msg("NFSv%d not supported!", nfsvers); |
521 | return 0; | 521 | return 0; |
522 | } | 522 | } |
523 | if (nfsvers && !mountvers) | 523 | if (nfsvers && !mountvers) |
@@ -577,11 +577,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
577 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); | 577 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); |
578 | } else { | 578 | } else { |
579 | if ((hp = gethostbyname(mounthost)) == NULL) { | 579 | if ((hp = gethostbyname(mounthost)) == NULL) { |
580 | error_msg("can't get address for %s\n", hostname); | 580 | error_msg("can't get address for %s", hostname); |
581 | goto fail; | 581 | goto fail; |
582 | } else { | 582 | } else { |
583 | if (hp->h_length > sizeof(struct in_addr)) { | 583 | if (hp->h_length > sizeof(struct in_addr)) { |
584 | error_msg("got bad hp->h_length?\n"); | 584 | error_msg("got bad hp->h_length?"); |
585 | hp->h_length = sizeof(struct in_addr); | 585 | hp->h_length = sizeof(struct in_addr); |
586 | } | 586 | } |
587 | mount_server_addr.sin_family = AF_INET; | 587 | mount_server_addr.sin_family = AF_INET; |
@@ -716,7 +716,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
716 | 716 | ||
717 | if (nfsvers == 2) { | 717 | if (nfsvers == 2) { |
718 | if (status.nfsv2.fhs_status != 0) { | 718 | if (status.nfsv2.fhs_status != 0) { |
719 | error_msg("%s:%s failed, reason given by server: %s\n", | 719 | error_msg("%s:%s failed, reason given by server: %s", |
720 | hostname, dirname, | 720 | hostname, dirname, |
721 | nfs_strerror(status.nfsv2.fhs_status)); | 721 | nfs_strerror(status.nfsv2.fhs_status)); |
722 | goto fail; | 722 | goto fail; |
@@ -734,7 +734,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
734 | #if NFS_MOUNT_VERSION >= 4 | 734 | #if NFS_MOUNT_VERSION >= 4 |
735 | fhandle3 *fhandle; | 735 | fhandle3 *fhandle; |
736 | if (status.nfsv3.fhs_status != 0) { | 736 | if (status.nfsv3.fhs_status != 0) { |
737 | error_msg("%s:%s failed, reason given by server: %s\n", | 737 | error_msg("%s:%s failed, reason given by server: %s", |
738 | hostname, dirname, | 738 | hostname, dirname, |
739 | nfs_strerror(status.nfsv3.fhs_status)); | 739 | nfs_strerror(status.nfsv3.fhs_status)); |
740 | goto fail; | 740 | goto fail; |
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ | 3 | * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -203,7 +203,7 @@ static void ping(const char *host) | |||
203 | 203 | ||
204 | pingaddr.sin_family = AF_INET; | 204 | pingaddr.sin_family = AF_INET; |
205 | if (!(h = gethostbyname(host))) { | 205 | if (!(h = gethostbyname(host))) { |
206 | error_msg("unknown host %s\n", host); | 206 | error_msg("unknown host %s", host); |
207 | exit(1); | 207 | exit(1); |
208 | } | 208 | } |
209 | memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr)); | 209 | memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr)); |
@@ -324,7 +324,7 @@ static void sendping(int junk) | |||
324 | if (i < 0) | 324 | if (i < 0) |
325 | perror_msg_and_die("sendto"); | 325 | perror_msg_and_die("sendto"); |
326 | else if ((size_t)i != sizeof(packet)) | 326 | else if ((size_t)i != sizeof(packet)) |
327 | error_msg_and_die("ping wrote %d chars; %d expected\n", i, | 327 | error_msg_and_die("ping wrote %d chars; %d expected", i, |
328 | (int)sizeof(packet)); | 328 | (int)sizeof(packet)); |
329 | 329 | ||
330 | signal(SIGALRM, sendping); | 330 | signal(SIGALRM, sendping); |
@@ -419,7 +419,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from) | |||
419 | printf("\n"); | 419 | printf("\n"); |
420 | } else | 420 | } else |
421 | if (icmppkt->icmp_type != ICMP_ECHO) | 421 | if (icmppkt->icmp_type != ICMP_ECHO) |
422 | error_msg("Warning: Got ICMP %d (%s)\n", | 422 | error_msg("Warning: Got ICMP %d (%s)", |
423 | icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); | 423 | icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); |
424 | } | 424 | } |
425 | 425 | ||
@@ -437,7 +437,7 @@ static void ping(const char *host) | |||
437 | if ((pingsock = socket(AF_INET, SOCK_RAW, | 437 | if ((pingsock = socket(AF_INET, SOCK_RAW, |
438 | (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */ | 438 | (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */ |
439 | if (errno == EPERM) | 439 | if (errno == EPERM) |
440 | error_msg_and_die("permission denied. (are you root?)\n"); | 440 | error_msg_and_die("permission denied. (are you root?)"); |
441 | else | 441 | else |
442 | perror_msg_and_die("creating a raw socket"); | 442 | perror_msg_and_die("creating a raw socket"); |
443 | } | 443 | } |
@@ -449,12 +449,12 @@ static void ping(const char *host) | |||
449 | 449 | ||
450 | pingaddr.sin_family = AF_INET; | 450 | pingaddr.sin_family = AF_INET; |
451 | if (!(h = gethostbyname(host))) { | 451 | if (!(h = gethostbyname(host))) { |
452 | error_msg("unknown host %s\n", host); | 452 | error_msg("unknown host %s", host); |
453 | exit(1); | 453 | exit(1); |
454 | } | 454 | } |
455 | 455 | ||
456 | if (h->h_addrtype != AF_INET) { | 456 | if (h->h_addrtype != AF_INET) { |
457 | error_msg("unknown address type; only AF_INET is currently supported.\n"); | 457 | error_msg("unknown address type; only AF_INET is currently supported."); |
458 | exit(1); | 458 | exit(1); |
459 | } | 459 | } |
460 | 460 | ||
diff --git a/procps/kill.c b/procps/kill.c index 3eb829abf..00a4d5c40 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -223,7 +223,7 @@ extern int kill_main(int argc, char **argv) | |||
223 | pidList = find_pid_by_name( *argv); | 223 | pidList = find_pid_by_name( *argv); |
224 | if (!pidList) { | 224 | if (!pidList) { |
225 | all_found = FALSE; | 225 | all_found = FALSE; |
226 | error_msg( "%s: no process killed\n", *argv); | 226 | error_msg( "%s: no process killed", *argv); |
227 | } | 227 | } |
228 | 228 | ||
229 | for(; pidList && *pidList!=0; pidList++) { | 229 | for(; pidList && *pidList!=0; pidList++) { |
@@ -246,5 +246,5 @@ extern int kill_main(int argc, char **argv) | |||
246 | 246 | ||
247 | 247 | ||
248 | end: | 248 | end: |
249 | error_msg_and_die( "bad signal name: %s\n", *argv); | 249 | error_msg_and_die( "bad signal name: %s", *argv); |
250 | } | 250 | } |
diff --git a/procps/ps.c b/procps/ps.c index 08597fe3a..4ff7a8a58 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -99,20 +99,20 @@ static void parse_proc_status(char *S, proc_t * P) | |||
99 | if (tmp) | 99 | if (tmp) |
100 | sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid); | 100 | sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid); |
101 | else | 101 | else |
102 | error_msg("Internal error!\n"); | 102 | error_msg("Internal error!"); |
103 | 103 | ||
104 | /* For busybox, ignoring effective, saved, etc */ | 104 | /* For busybox, ignoring effective, saved, etc */ |
105 | tmp = strstr(S, "Uid:"); | 105 | tmp = strstr(S, "Uid:"); |
106 | if (tmp) | 106 | if (tmp) |
107 | sscanf(tmp, "Uid:\t%d", &P->ruid); | 107 | sscanf(tmp, "Uid:\t%d", &P->ruid); |
108 | else | 108 | else |
109 | error_msg("Internal error!\n"); | 109 | error_msg("Internal error!"); |
110 | 110 | ||
111 | tmp = strstr(S, "Gid:"); | 111 | tmp = strstr(S, "Gid:"); |
112 | if (tmp) | 112 | if (tmp) |
113 | sscanf(tmp, "Gid:\t%d", &P->rgid); | 113 | sscanf(tmp, "Gid:\t%d", &P->rgid); |
114 | else | 114 | else |
115 | error_msg("Internal error!\n"); | 115 | error_msg("Internal error!"); |
116 | 116 | ||
117 | } | 117 | } |
118 | 118 | ||
@@ -137,7 +137,7 @@ extern int ps_main(int argc, char **argv) | |||
137 | 137 | ||
138 | dir = opendir("/proc"); | 138 | dir = opendir("/proc"); |
139 | if (!dir) | 139 | if (!dir) |
140 | error_msg_and_die("Can't open /proc\n"); | 140 | error_msg_and_die("Can't open /proc"); |
141 | 141 | ||
142 | #ifdef BB_FEATURE_AUTOWIDTH | 142 | #ifdef BB_FEATURE_AUTOWIDTH |
143 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 143 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
@@ -99,20 +99,20 @@ static void parse_proc_status(char *S, proc_t * P) | |||
99 | if (tmp) | 99 | if (tmp) |
100 | sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid); | 100 | sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid); |
101 | else | 101 | else |
102 | error_msg("Internal error!\n"); | 102 | error_msg("Internal error!"); |
103 | 103 | ||
104 | /* For busybox, ignoring effective, saved, etc */ | 104 | /* For busybox, ignoring effective, saved, etc */ |
105 | tmp = strstr(S, "Uid:"); | 105 | tmp = strstr(S, "Uid:"); |
106 | if (tmp) | 106 | if (tmp) |
107 | sscanf(tmp, "Uid:\t%d", &P->ruid); | 107 | sscanf(tmp, "Uid:\t%d", &P->ruid); |
108 | else | 108 | else |
109 | error_msg("Internal error!\n"); | 109 | error_msg("Internal error!"); |
110 | 110 | ||
111 | tmp = strstr(S, "Gid:"); | 111 | tmp = strstr(S, "Gid:"); |
112 | if (tmp) | 112 | if (tmp) |
113 | sscanf(tmp, "Gid:\t%d", &P->rgid); | 113 | sscanf(tmp, "Gid:\t%d", &P->rgid); |
114 | else | 114 | else |
115 | error_msg("Internal error!\n"); | 115 | error_msg("Internal error!"); |
116 | 116 | ||
117 | } | 117 | } |
118 | 118 | ||
@@ -137,7 +137,7 @@ extern int ps_main(int argc, char **argv) | |||
137 | 137 | ||
138 | dir = opendir("/proc"); | 138 | dir = opendir("/proc"); |
139 | if (!dir) | 139 | if (!dir) |
140 | error_msg_and_die("Can't open /proc\n"); | 140 | error_msg_and_die("Can't open /proc"); |
141 | 141 | ||
142 | #ifdef BB_FEATURE_AUTOWIDTH | 142 | #ifdef BB_FEATURE_AUTOWIDTH |
143 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 143 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
@@ -72,7 +72,7 @@ time_t askremotedate(char *host) | |||
72 | } | 72 | } |
73 | if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */ | 73 | if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */ |
74 | close(fd); | 74 | close(fd); |
75 | error_msg("%s did not send the complete time\n", host); | 75 | error_msg("%s did not send the complete time", host); |
76 | } | 76 | } |
77 | close(fd); | 77 | close(fd); |
78 | 78 | ||
diff --git a/rpmunpack.c b/rpmunpack.c index 85c7c9c1e..e37ac2cfa 100644 --- a/rpmunpack.c +++ b/rpmunpack.c | |||
@@ -44,7 +44,7 @@ static void myread(int num, char *buffer) | |||
44 | if (err < 0) | 44 | if (err < 0) |
45 | perror_msg_and_die(progname); | 45 | perror_msg_and_die(progname); |
46 | else | 46 | else |
47 | error_msg_and_die("Unexpected end of input file!\n"); | 47 | error_msg_and_die("Unexpected end of input file!"); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
@@ -169,7 +169,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
169 | else if (my_str[idx] == '/') { | 169 | else if (my_str[idx] == '/') { |
170 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx); | 170 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, my_str, ++idx); |
171 | if (idx == -1) | 171 | if (idx == -1) |
172 | error_msg_and_die("unterminated match expression\n"); | 172 | error_msg_and_die("unterminated match expression"); |
173 | my_str[idx] = '\0'; | 173 | my_str[idx] = '\0'; |
174 | *regex = (regex_t *)xmalloc(sizeof(regex_t)); | 174 | *regex = (regex_t *)xmalloc(sizeof(regex_t)); |
175 | xregcomp(*regex, my_str+1, 0); | 175 | xregcomp(*regex, my_str+1, 0); |
@@ -177,7 +177,7 @@ static int get_address(struct sed_cmd *sed_cmd, const char *str, int *line, rege | |||
177 | } | 177 | } |
178 | else { | 178 | else { |
179 | error_msg("get_address: no address found in string\n" | 179 | error_msg("get_address: no address found in string\n" |
180 | "\t(you probably didn't check the string you passed me)\n"); | 180 | "\t(you probably didn't check the string you passed me)"); |
181 | idx = -1; | 181 | idx = -1; |
182 | } | 182 | } |
183 | 183 | ||
@@ -213,7 +213,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
213 | /* verify that the 's' is followed by something. That something | 213 | /* verify that the 's' is followed by something. That something |
214 | * (typically a 'slash') is now our regexp delimiter... */ | 214 | * (typically a 'slash') is now our regexp delimiter... */ |
215 | if (!substr[++idx]) | 215 | if (!substr[++idx]) |
216 | error_msg_and_die("bad format in substitution expression\n"); | 216 | error_msg_and_die("bad format in substitution expression"); |
217 | else | 217 | else |
218 | sed_cmd->delimiter=substr[idx]; | 218 | sed_cmd->delimiter=substr[idx]; |
219 | 219 | ||
@@ -221,7 +221,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
221 | oldidx = idx+1; | 221 | oldidx = idx+1; |
222 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); | 222 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); |
223 | if (idx == -1) | 223 | if (idx == -1) |
224 | error_msg_and_die("bad format in substitution expression\n"); | 224 | error_msg_and_die("bad format in substitution expression"); |
225 | match = strdup_substr(substr, oldidx, idx); | 225 | match = strdup_substr(substr, oldidx, idx); |
226 | 226 | ||
227 | /* determine the number of back references in the match string */ | 227 | /* determine the number of back references in the match string */ |
@@ -240,7 +240,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
240 | oldidx = idx+1; | 240 | oldidx = idx+1; |
241 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); | 241 | idx = index_of_next_unescaped_regexp_delim(sed_cmd, substr, ++idx); |
242 | if (idx == -1) | 242 | if (idx == -1) |
243 | error_msg_and_die("bad format in substitution expression\n"); | 243 | error_msg_and_die("bad format in substitution expression"); |
244 | sed_cmd->replace = strdup_substr(substr, oldidx, idx); | 244 | sed_cmd->replace = strdup_substr(substr, oldidx, idx); |
245 | 245 | ||
246 | /* process the flags */ | 246 | /* process the flags */ |
@@ -260,7 +260,7 @@ static int parse_subst_cmd(struct sed_cmd *sed_cmd, const char *substr) | |||
260 | if (strchr("; \t\v\n\r", substr[idx])) | 260 | if (strchr("; \t\v\n\r", substr[idx])) |
261 | goto out; | 261 | goto out; |
262 | /* else */ | 262 | /* else */ |
263 | error_msg_and_die("bad option in substitution expression\n"); | 263 | error_msg_and_die("bad option in substitution expression"); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
@@ -302,7 +302,7 @@ static int parse_edit_cmd(struct sed_cmd *sed_cmd, const char *editstr) | |||
302 | */ | 302 | */ |
303 | 303 | ||
304 | if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r')) | 304 | if (editstr[1] != '\\' && (editstr[2] != '\n' || editstr[2] != '\r')) |
305 | error_msg_and_die("bad format in edit expression\n"); | 305 | error_msg_and_die("bad format in edit expression"); |
306 | 306 | ||
307 | /* store the edit line text */ | 307 | /* store the edit line text */ |
308 | /* make editline big enough to accomodate the extra '\n' we will tack on | 308 | /* make editline big enough to accomodate the extra '\n' we will tack on |
@@ -366,9 +366,9 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr) | |||
366 | 366 | ||
367 | /* last part (mandatory) will be a command */ | 367 | /* last part (mandatory) will be a command */ |
368 | if (cmdstr[idx] == '\0') | 368 | if (cmdstr[idx] == '\0') |
369 | error_msg_and_die("missing command\n"); | 369 | error_msg_and_die("missing command"); |
370 | if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */ | 370 | if (!strchr("pdsaic", cmdstr[idx])) /* <-- XXX add new commands here */ |
371 | error_msg_and_die("invalid command\n"); | 371 | error_msg_and_die("invalid command"); |
372 | sed_cmd->cmd = cmdstr[idx]; | 372 | sed_cmd->cmd = cmdstr[idx]; |
373 | 373 | ||
374 | /* special-case handling for (s)ubstitution */ | 374 | /* special-case handling for (s)ubstitution */ |
@@ -378,7 +378,7 @@ static char *parse_cmd_str(struct sed_cmd *sed_cmd, const char *cmdstr) | |||
378 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ | 378 | /* special-case handling for (a)ppend, (i)nsert, and (c)hange */ |
379 | else if (strchr("aic", cmdstr[idx])) { | 379 | else if (strchr("aic", cmdstr[idx])) { |
380 | if (sed_cmd->end_line || sed_cmd->end_match) | 380 | if (sed_cmd->end_line || sed_cmd->end_match) |
381 | error_msg_and_die("only a beginning address can be specified for edit commands\n"); | 381 | error_msg_and_die("only a beginning address can be specified for edit commands"); |
382 | idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]); | 382 | idx += parse_edit_cmd(sed_cmd, &cmdstr[idx]); |
383 | } | 383 | } |
384 | /* if it was a single-letter command (such as 'p' or 'd') we need to | 384 | /* if it was a single-letter command (such as 'p' or 'd') we need to |
diff --git a/setkeycodes.c b/setkeycodes.c index be9b1b797..3e511ad00 100644 --- a/setkeycodes.c +++ b/setkeycodes.c | |||
@@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv) | |||
52 | a.keycode = atoi(argv[2]); | 52 | a.keycode = atoi(argv[2]); |
53 | a.scancode = sc = strtol(argv[1], &ep, 16); | 53 | a.scancode = sc = strtol(argv[1], &ep, 16); |
54 | if (*ep) { | 54 | if (*ep) { |
55 | error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]); | 55 | error_msg_and_die("error reading SCANCODE: '%s'", argv[1]); |
56 | } | 56 | } |
57 | if (a.scancode > 127) { | 57 | if (a.scancode > 127) { |
58 | a.scancode -= 0xe000; | 58 | a.scancode -= 0xe000; |
59 | a.scancode += 128; | 59 | a.scancode += 128; |
60 | } | 60 | } |
61 | if (a.scancode > 255 || a.keycode > 127) { | 61 | if (a.scancode > 255 || a.keycode > 127) { |
62 | error_msg_and_die("SCANCODE or KEYCODE outside bounds\n"); | 62 | error_msg_and_die("SCANCODE or KEYCODE outside bounds"); |
63 | } | 63 | } |
64 | if (ioctl(fd,KDSETKEYCODE,&a)) { | 64 | if (ioctl(fd,KDSETKEYCODE,&a)) { |
65 | perror("KDSETKEYCODE"); | 65 | perror("KDSETKEYCODE"); |
66 | error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode); | 66 | error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode); |
67 | } | 67 | } |
68 | argc -= 2; | 68 | argc -= 2; |
69 | argv += 2; | 69 | argv += 2; |
@@ -321,13 +321,13 @@ static int builtin_fg_bg(struct child_prog *child) | |||
321 | struct job *job=NULL; | 321 | struct job *job=NULL; |
322 | 322 | ||
323 | if (!child->argv[1] || child->argv[2]) { | 323 | if (!child->argv[1] || child->argv[2]) { |
324 | error_msg("%s: exactly one argument is expected\n", | 324 | error_msg("%s: exactly one argument is expected", |
325 | child->argv[0]); | 325 | child->argv[0]); |
326 | return EXIT_FAILURE; | 326 | return EXIT_FAILURE; |
327 | } | 327 | } |
328 | 328 | ||
329 | if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) { | 329 | if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) { |
330 | error_msg("%s: bad argument '%s'\n", | 330 | error_msg("%s: bad argument '%s'", |
331 | child->argv[0], child->argv[1]); | 331 | child->argv[0], child->argv[1]); |
332 | return EXIT_FAILURE; | 332 | return EXIT_FAILURE; |
333 | } | 333 | } |
@@ -339,7 +339,7 @@ static int builtin_fg_bg(struct child_prog *child) | |||
339 | } | 339 | } |
340 | 340 | ||
341 | if (!job) { | 341 | if (!job) { |
342 | error_msg("%s: unknown job %d\n", | 342 | error_msg("%s: unknown job %d", |
343 | child->argv[0], jobNum); | 343 | child->argv[0], jobNum); |
344 | return EXIT_FAILURE; | 344 | return EXIT_FAILURE; |
345 | } | 345 | } |
@@ -492,7 +492,7 @@ static int builtin_then(struct child_prog *child) | |||
492 | debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context); | 492 | debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context); |
493 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 493 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
494 | shell_context = 0; /* Reset the shell's context on an error */ | 494 | shell_context = 0; /* Reset the shell's context on an error */ |
495 | error_msg("%s `then'\n", syntax_err); | 495 | error_msg("%s `then'", syntax_err); |
496 | return EXIT_FAILURE; | 496 | return EXIT_FAILURE; |
497 | } | 497 | } |
498 | 498 | ||
@@ -520,7 +520,7 @@ static int builtin_else(struct child_prog *child) | |||
520 | 520 | ||
521 | if (! (cmd->job_context & THEN_EXP_CONTEXT)) { | 521 | if (! (cmd->job_context & THEN_EXP_CONTEXT)) { |
522 | shell_context = 0; /* Reset the shell's context on an error */ | 522 | shell_context = 0; /* Reset the shell's context on an error */ |
523 | error_msg("%s `else'\n", syntax_err); | 523 | error_msg("%s `else'", syntax_err); |
524 | return EXIT_FAILURE; | 524 | return EXIT_FAILURE; |
525 | } | 525 | } |
526 | /* If the if result was TRUE, skip the 'else' stuff */ | 526 | /* If the if result was TRUE, skip the 'else' stuff */ |
@@ -543,7 +543,7 @@ static int builtin_fi(struct child_prog *child) | |||
543 | debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context); | 543 | debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context); |
544 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 544 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
545 | shell_context = 0; /* Reset the shell's context on an error */ | 545 | shell_context = 0; /* Reset the shell's context on an error */ |
546 | error_msg("%s `fi'\n", syntax_err); | 546 | error_msg("%s `fi'", syntax_err); |
547 | return EXIT_FAILURE; | 547 | return EXIT_FAILURE; |
548 | } | 548 | } |
549 | /* Clear out the if and then context bits */ | 549 | /* Clear out the if and then context bits */ |
@@ -748,7 +748,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[]) | |||
748 | if (openfd < 0) { | 748 | if (openfd < 0) { |
749 | /* this could get lost if stderr has been redirected, but | 749 | /* this could get lost if stderr has been redirected, but |
750 | bash and ash both lose it as well (though zsh doesn't!) */ | 750 | bash and ash both lose it as well (though zsh doesn't!) */ |
751 | error_msg("error opening %s: %s\n", redir->filename, | 751 | error_msg("error opening %s: %s", redir->filename, |
752 | strerror(errno)); | 752 | strerror(errno)); |
753 | return 1; | 753 | return 1; |
754 | } | 754 | } |
@@ -960,7 +960,7 @@ static void expand_argument(struct child_prog *prog, int *argcPtr, | |||
960 | if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){ | 960 | if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){ |
961 | rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result); | 961 | rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result); |
962 | if (rc == GLOB_NOSPACE) { | 962 | if (rc == GLOB_NOSPACE) { |
963 | error_msg("out of space during glob operation\n"); | 963 | error_msg("out of space during glob operation"); |
964 | return; | 964 | return; |
965 | } else if (rc == GLOB_NOMATCH || | 965 | } else if (rc == GLOB_NOMATCH || |
966 | (!rc && (prog->glob_result.gl_pathc - i) == 1 && | 966 | (!rc && (prog->glob_result.gl_pathc - i) == 1 && |
@@ -1068,7 +1068,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1068 | if (*src == '\\') { | 1068 | if (*src == '\\') { |
1069 | src++; | 1069 | src++; |
1070 | if (!*src) { | 1070 | if (!*src) { |
1071 | error_msg("character expected after \\\n"); | 1071 | error_msg("character expected after \\"); |
1072 | free_job(job); | 1072 | free_job(job); |
1073 | return 1; | 1073 | return 1; |
1074 | } | 1074 | } |
@@ -1152,7 +1152,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1152 | chptr++; | 1152 | chptr++; |
1153 | 1153 | ||
1154 | if (!*chptr) { | 1154 | if (!*chptr) { |
1155 | error_msg("file name expected after %c\n", *src); | 1155 | error_msg("file name expected after %c", *src); |
1156 | free_job(job); | 1156 | free_job(job); |
1157 | job->num_progs=0; | 1157 | job->num_progs=0; |
1158 | return 1; | 1158 | return 1; |
@@ -1171,7 +1171,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1171 | if (*prog->argv[argc_l]) | 1171 | if (*prog->argv[argc_l]) |
1172 | argc_l++; | 1172 | argc_l++; |
1173 | if (!argc_l) { | 1173 | if (!argc_l) { |
1174 | error_msg("empty command in pipe\n"); | 1174 | error_msg("empty command in pipe"); |
1175 | free_job(job); | 1175 | free_job(job); |
1176 | job->num_progs=0; | 1176 | job->num_progs=0; |
1177 | return 1; | 1177 | return 1; |
@@ -1199,7 +1199,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1199 | src++; | 1199 | src++; |
1200 | 1200 | ||
1201 | if (!*src) { | 1201 | if (!*src) { |
1202 | error_msg("empty command in pipe\n"); | 1202 | error_msg("empty command in pipe"); |
1203 | free_job(job); | 1203 | free_job(job); |
1204 | job->num_progs=0; | 1204 | job->num_progs=0; |
1205 | return 1; | 1205 | return 1; |
@@ -1307,7 +1307,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1307 | printf("erik: found a continue char at EOL...\n"); | 1307 | printf("erik: found a continue char at EOL...\n"); |
1308 | command = (char *) xcalloc(BUFSIZ, sizeof(char)); | 1308 | command = (char *) xcalloc(BUFSIZ, sizeof(char)); |
1309 | if (get_command(input, command)) { | 1309 | if (get_command(input, command)) { |
1310 | error_msg("character expected after \\\n"); | 1310 | error_msg("character expected after \\"); |
1311 | free(command); | 1311 | free(command); |
1312 | free_job(job); | 1312 | free_job(job); |
1313 | return 1; | 1313 | return 1; |
@@ -1323,7 +1323,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1323 | free(command); | 1323 | free(command); |
1324 | break; | 1324 | break; |
1325 | #else | 1325 | #else |
1326 | error_msg("character expected after \\\n"); | 1326 | error_msg("character expected after \\"); |
1327 | free(command); | 1327 | free(command); |
1328 | free_job(job); | 1328 | free_job(job); |
1329 | return 1; | 1329 | return 1; |
@@ -1738,7 +1738,7 @@ int shell_main(int argc_l, char **argv_l) | |||
1738 | case 'c': | 1738 | case 'c': |
1739 | input = NULL; | 1739 | input = NULL; |
1740 | if (local_pending_command != 0) | 1740 | if (local_pending_command != 0) |
1741 | error_msg_and_die("multiple -c arguments\n"); | 1741 | error_msg_and_die("multiple -c arguments"); |
1742 | local_pending_command = xstrdup(argv[optind]); | 1742 | local_pending_command = xstrdup(argv[optind]); |
1743 | optind++; | 1743 | optind++; |
1744 | argv = argv+optind; | 1744 | argv = argv+optind; |
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 169032697..ed441d394 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -318,7 +318,7 @@ static void cmdedit_setwidth(int w, int redraw_flg) | |||
318 | input_backward(); | 318 | input_backward(); |
319 | } | 319 | } |
320 | } else { | 320 | } else { |
321 | error_msg("\n*** Error: minimum screen width is %d\n", cmdedit_termw); | 321 | error_msg("\n*** Error: minimum screen width is %d", cmdedit_termw); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
diff --git a/shell/lash.c b/shell/lash.c index b3bdcc986..cc0d78687 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -321,13 +321,13 @@ static int builtin_fg_bg(struct child_prog *child) | |||
321 | struct job *job=NULL; | 321 | struct job *job=NULL; |
322 | 322 | ||
323 | if (!child->argv[1] || child->argv[2]) { | 323 | if (!child->argv[1] || child->argv[2]) { |
324 | error_msg("%s: exactly one argument is expected\n", | 324 | error_msg("%s: exactly one argument is expected", |
325 | child->argv[0]); | 325 | child->argv[0]); |
326 | return EXIT_FAILURE; | 326 | return EXIT_FAILURE; |
327 | } | 327 | } |
328 | 328 | ||
329 | if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) { | 329 | if (sscanf(child->argv[1], "%%%d", &jobNum) != 1) { |
330 | error_msg("%s: bad argument '%s'\n", | 330 | error_msg("%s: bad argument '%s'", |
331 | child->argv[0], child->argv[1]); | 331 | child->argv[0], child->argv[1]); |
332 | return EXIT_FAILURE; | 332 | return EXIT_FAILURE; |
333 | } | 333 | } |
@@ -339,7 +339,7 @@ static int builtin_fg_bg(struct child_prog *child) | |||
339 | } | 339 | } |
340 | 340 | ||
341 | if (!job) { | 341 | if (!job) { |
342 | error_msg("%s: unknown job %d\n", | 342 | error_msg("%s: unknown job %d", |
343 | child->argv[0], jobNum); | 343 | child->argv[0], jobNum); |
344 | return EXIT_FAILURE; | 344 | return EXIT_FAILURE; |
345 | } | 345 | } |
@@ -492,7 +492,7 @@ static int builtin_then(struct child_prog *child) | |||
492 | debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context); | 492 | debug_printf( "job=%p entering builtin_then ('%s')-- context=%d\n", cmd, charptr1, cmd->job_context); |
493 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 493 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
494 | shell_context = 0; /* Reset the shell's context on an error */ | 494 | shell_context = 0; /* Reset the shell's context on an error */ |
495 | error_msg("%s `then'\n", syntax_err); | 495 | error_msg("%s `then'", syntax_err); |
496 | return EXIT_FAILURE; | 496 | return EXIT_FAILURE; |
497 | } | 497 | } |
498 | 498 | ||
@@ -520,7 +520,7 @@ static int builtin_else(struct child_prog *child) | |||
520 | 520 | ||
521 | if (! (cmd->job_context & THEN_EXP_CONTEXT)) { | 521 | if (! (cmd->job_context & THEN_EXP_CONTEXT)) { |
522 | shell_context = 0; /* Reset the shell's context on an error */ | 522 | shell_context = 0; /* Reset the shell's context on an error */ |
523 | error_msg("%s `else'\n", syntax_err); | 523 | error_msg("%s `else'", syntax_err); |
524 | return EXIT_FAILURE; | 524 | return EXIT_FAILURE; |
525 | } | 525 | } |
526 | /* If the if result was TRUE, skip the 'else' stuff */ | 526 | /* If the if result was TRUE, skip the 'else' stuff */ |
@@ -543,7 +543,7 @@ static int builtin_fi(struct child_prog *child) | |||
543 | debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context); | 543 | debug_printf( "job=%p entering builtin_fi ('%s')-- context=%d\n", cmd, "", cmd->job_context); |
544 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 544 | if (! (cmd->job_context & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
545 | shell_context = 0; /* Reset the shell's context on an error */ | 545 | shell_context = 0; /* Reset the shell's context on an error */ |
546 | error_msg("%s `fi'\n", syntax_err); | 546 | error_msg("%s `fi'", syntax_err); |
547 | return EXIT_FAILURE; | 547 | return EXIT_FAILURE; |
548 | } | 548 | } |
549 | /* Clear out the if and then context bits */ | 549 | /* Clear out the if and then context bits */ |
@@ -748,7 +748,7 @@ static int setup_redirects(struct child_prog *prog, int squirrel[]) | |||
748 | if (openfd < 0) { | 748 | if (openfd < 0) { |
749 | /* this could get lost if stderr has been redirected, but | 749 | /* this could get lost if stderr has been redirected, but |
750 | bash and ash both lose it as well (though zsh doesn't!) */ | 750 | bash and ash both lose it as well (though zsh doesn't!) */ |
751 | error_msg("error opening %s: %s\n", redir->filename, | 751 | error_msg("error opening %s: %s", redir->filename, |
752 | strerror(errno)); | 752 | strerror(errno)); |
753 | return 1; | 753 | return 1; |
754 | } | 754 | } |
@@ -960,7 +960,7 @@ static void expand_argument(struct child_prog *prog, int *argcPtr, | |||
960 | if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){ | 960 | if (strpbrk(prog->argv[argc_l - 1],"*[]?")!= NULL){ |
961 | rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result); | 961 | rc = glob(prog->argv[argc_l - 1], flags, NULL, &prog->glob_result); |
962 | if (rc == GLOB_NOSPACE) { | 962 | if (rc == GLOB_NOSPACE) { |
963 | error_msg("out of space during glob operation\n"); | 963 | error_msg("out of space during glob operation"); |
964 | return; | 964 | return; |
965 | } else if (rc == GLOB_NOMATCH || | 965 | } else if (rc == GLOB_NOMATCH || |
966 | (!rc && (prog->glob_result.gl_pathc - i) == 1 && | 966 | (!rc && (prog->glob_result.gl_pathc - i) == 1 && |
@@ -1068,7 +1068,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1068 | if (*src == '\\') { | 1068 | if (*src == '\\') { |
1069 | src++; | 1069 | src++; |
1070 | if (!*src) { | 1070 | if (!*src) { |
1071 | error_msg("character expected after \\\n"); | 1071 | error_msg("character expected after \\"); |
1072 | free_job(job); | 1072 | free_job(job); |
1073 | return 1; | 1073 | return 1; |
1074 | } | 1074 | } |
@@ -1152,7 +1152,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1152 | chptr++; | 1152 | chptr++; |
1153 | 1153 | ||
1154 | if (!*chptr) { | 1154 | if (!*chptr) { |
1155 | error_msg("file name expected after %c\n", *src); | 1155 | error_msg("file name expected after %c", *src); |
1156 | free_job(job); | 1156 | free_job(job); |
1157 | job->num_progs=0; | 1157 | job->num_progs=0; |
1158 | return 1; | 1158 | return 1; |
@@ -1171,7 +1171,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1171 | if (*prog->argv[argc_l]) | 1171 | if (*prog->argv[argc_l]) |
1172 | argc_l++; | 1172 | argc_l++; |
1173 | if (!argc_l) { | 1173 | if (!argc_l) { |
1174 | error_msg("empty command in pipe\n"); | 1174 | error_msg("empty command in pipe"); |
1175 | free_job(job); | 1175 | free_job(job); |
1176 | job->num_progs=0; | 1176 | job->num_progs=0; |
1177 | return 1; | 1177 | return 1; |
@@ -1199,7 +1199,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1199 | src++; | 1199 | src++; |
1200 | 1200 | ||
1201 | if (!*src) { | 1201 | if (!*src) { |
1202 | error_msg("empty command in pipe\n"); | 1202 | error_msg("empty command in pipe"); |
1203 | free_job(job); | 1203 | free_job(job); |
1204 | job->num_progs=0; | 1204 | job->num_progs=0; |
1205 | return 1; | 1205 | return 1; |
@@ -1307,7 +1307,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1307 | printf("erik: found a continue char at EOL...\n"); | 1307 | printf("erik: found a continue char at EOL...\n"); |
1308 | command = (char *) xcalloc(BUFSIZ, sizeof(char)); | 1308 | command = (char *) xcalloc(BUFSIZ, sizeof(char)); |
1309 | if (get_command(input, command)) { | 1309 | if (get_command(input, command)) { |
1310 | error_msg("character expected after \\\n"); | 1310 | error_msg("character expected after \\"); |
1311 | free(command); | 1311 | free(command); |
1312 | free_job(job); | 1312 | free_job(job); |
1313 | return 1; | 1313 | return 1; |
@@ -1323,7 +1323,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg) | |||
1323 | free(command); | 1323 | free(command); |
1324 | break; | 1324 | break; |
1325 | #else | 1325 | #else |
1326 | error_msg("character expected after \\\n"); | 1326 | error_msg("character expected after \\"); |
1327 | free(command); | 1327 | free(command); |
1328 | free_job(job); | 1328 | free_job(job); |
1329 | return 1; | 1329 | return 1; |
@@ -1738,7 +1738,7 @@ int shell_main(int argc_l, char **argv_l) | |||
1738 | case 'c': | 1738 | case 'c': |
1739 | input = NULL; | 1739 | input = NULL; |
1740 | if (local_pending_command != 0) | 1740 | if (local_pending_command != 0) |
1741 | error_msg_and_die("multiple -c arguments\n"); | 1741 | error_msg_and_die("multiple -c arguments"); |
1742 | local_pending_command = xstrdup(argv[optind]); | 1742 | local_pending_command = xstrdup(argv[optind]); |
1743 | optind++; | 1743 | optind++; |
1744 | argv = argv+optind; | 1744 | argv = argv+optind; |
diff --git a/swaponoff.c b/swaponoff.c index 8a9134ca0..74f6ec36e 100644 --- a/swaponoff.c +++ b/swaponoff.c | |||
@@ -95,7 +95,7 @@ extern int swap_on_off_main(int argc, char **argv) | |||
95 | struct stat statBuf; | 95 | struct stat statBuf; |
96 | 96 | ||
97 | if (stat("/etc/fstab", &statBuf) < 0) | 97 | if (stat("/etc/fstab", &statBuf) < 0) |
98 | error_msg_and_die("/etc/fstab file missing\n"); | 98 | error_msg_and_die("/etc/fstab file missing"); |
99 | } | 99 | } |
100 | do_em_all(); | 100 | do_em_all(); |
101 | break; | 101 | break; |
diff --git a/sysklogd/logger.c b/sysklogd/logger.c index 1ab868d75..85c63b8a5 100644 --- a/sysklogd/logger.c +++ b/sysklogd/logger.c | |||
@@ -87,14 +87,14 @@ static int pencode(char *s) | |||
87 | *s = '\0'; | 87 | *s = '\0'; |
88 | fac = decode(save, facilitynames); | 88 | fac = decode(save, facilitynames); |
89 | if (fac < 0) | 89 | if (fac < 0) |
90 | error_msg_and_die("unknown facility name: %s\n", save); | 90 | error_msg_and_die("unknown facility name: %s", save); |
91 | *s++ = '.'; | 91 | *s++ = '.'; |
92 | } else { | 92 | } else { |
93 | s = save; | 93 | s = save; |
94 | } | 94 | } |
95 | lev = decode(s, prioritynames); | 95 | lev = decode(s, prioritynames); |
96 | if (lev < 0) | 96 | if (lev < 0) |
97 | error_msg_and_die("unknown priority name: %s\n", save); | 97 | error_msg_and_die("unknown priority name: %s", save); |
98 | return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); | 98 | return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK)); |
99 | } | 99 | } |
100 | 100 | ||
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 8eb74c69f..7bd4bdcb2 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -182,7 +182,7 @@ static const int IOV_COUNT = 2; | |||
182 | 182 | ||
183 | if ( -1 == writev(remotefd,iov, IOV_COUNT)){ | 183 | if ( -1 == writev(remotefd,iov, IOV_COUNT)){ |
184 | error_msg_and_die("syslogd: cannot write to remote file handle on" | 184 | error_msg_and_die("syslogd: cannot write to remote file handle on" |
185 | "%s:%d\n",RemoteHost,RemotePort); | 185 | "%s:%d",RemoteHost,RemotePort); |
186 | } | 186 | } |
187 | } | 187 | } |
188 | if (local_logging == TRUE) | 188 | if (local_logging == TRUE) |
@@ -264,13 +264,13 @@ static void init_RemoteLog (void){ | |||
264 | remotefd = socket(AF_INET, SOCK_DGRAM, 0); | 264 | remotefd = socket(AF_INET, SOCK_DGRAM, 0); |
265 | 265 | ||
266 | if (remotefd < 0) { | 266 | if (remotefd < 0) { |
267 | error_msg_and_die("syslogd: cannot create socket\n"); | 267 | error_msg_and_die("syslogd: cannot create socket"); |
268 | } | 268 | } |
269 | 269 | ||
270 | hostinfo = (struct hostent *) gethostbyname(RemoteHost); | 270 | hostinfo = (struct hostent *) gethostbyname(RemoteHost); |
271 | 271 | ||
272 | if (!hostinfo) { | 272 | if (!hostinfo) { |
273 | error_msg_and_die("syslogd: cannot resolve remote host name [%s]\n", RemoteHost); | 273 | error_msg_and_die("syslogd: cannot resolve remote host name [%s]", RemoteHost); |
274 | } | 274 | } |
275 | 275 | ||
276 | remoteaddr.sin_family = AF_INET; | 276 | remoteaddr.sin_family = AF_INET; |
@@ -282,7 +282,7 @@ static void init_RemoteLog (void){ | |||
282 | for future operations | 282 | for future operations |
283 | */ | 283 | */ |
284 | if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){ | 284 | if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){ |
285 | error_msg_and_die("syslogd: cannot connect to remote host %s:%d\n", RemoteHost, RemotePort); | 285 | error_msg_and_die("syslogd: cannot connect to remote host %s:%d", RemoteHost, RemotePort); |
286 | } | 286 | } |
287 | 287 | ||
288 | } | 288 | } |
@@ -182,7 +182,7 @@ static const int IOV_COUNT = 2; | |||
182 | 182 | ||
183 | if ( -1 == writev(remotefd,iov, IOV_COUNT)){ | 183 | if ( -1 == writev(remotefd,iov, IOV_COUNT)){ |
184 | error_msg_and_die("syslogd: cannot write to remote file handle on" | 184 | error_msg_and_die("syslogd: cannot write to remote file handle on" |
185 | "%s:%d\n",RemoteHost,RemotePort); | 185 | "%s:%d",RemoteHost,RemotePort); |
186 | } | 186 | } |
187 | } | 187 | } |
188 | if (local_logging == TRUE) | 188 | if (local_logging == TRUE) |
@@ -264,13 +264,13 @@ static void init_RemoteLog (void){ | |||
264 | remotefd = socket(AF_INET, SOCK_DGRAM, 0); | 264 | remotefd = socket(AF_INET, SOCK_DGRAM, 0); |
265 | 265 | ||
266 | if (remotefd < 0) { | 266 | if (remotefd < 0) { |
267 | error_msg_and_die("syslogd: cannot create socket\n"); | 267 | error_msg_and_die("syslogd: cannot create socket"); |
268 | } | 268 | } |
269 | 269 | ||
270 | hostinfo = (struct hostent *) gethostbyname(RemoteHost); | 270 | hostinfo = (struct hostent *) gethostbyname(RemoteHost); |
271 | 271 | ||
272 | if (!hostinfo) { | 272 | if (!hostinfo) { |
273 | error_msg_and_die("syslogd: cannot resolve remote host name [%s]\n", RemoteHost); | 273 | error_msg_and_die("syslogd: cannot resolve remote host name [%s]", RemoteHost); |
274 | } | 274 | } |
275 | 275 | ||
276 | remoteaddr.sin_family = AF_INET; | 276 | remoteaddr.sin_family = AF_INET; |
@@ -282,7 +282,7 @@ static void init_RemoteLog (void){ | |||
282 | for future operations | 282 | for future operations |
283 | */ | 283 | */ |
284 | if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){ | 284 | if ( 0 != (connect(remotefd, (struct sockaddr *) &remoteaddr, len))){ |
285 | error_msg_and_die("syslogd: cannot connect to remote host %s:%d\n", RemoteHost, RemotePort); | 285 | error_msg_and_die("syslogd: cannot connect to remote host %s:%d", RemoteHost, RemotePort); |
286 | } | 286 | } |
287 | 287 | ||
288 | } | 288 | } |
@@ -165,10 +165,10 @@ extern int tar_unzip_init(int tarFd) | |||
165 | signal(SIGCHLD, child_died); | 165 | signal(SIGCHLD, child_died); |
166 | 166 | ||
167 | if (pipe(unzip_pipe)!=0) | 167 | if (pipe(unzip_pipe)!=0) |
168 | error_msg_and_die("pipe error\n"); | 168 | error_msg_and_die("pipe error"); |
169 | 169 | ||
170 | if ( (child_pid = fork()) == -1) | 170 | if ( (child_pid = fork()) == -1) |
171 | error_msg_and_die("fork failure\n"); | 171 | error_msg_and_die("fork failure"); |
172 | 172 | ||
173 | if (child_pid==0) { | 173 | if (child_pid==0) { |
174 | /* child process */ | 174 | /* child process */ |
@@ -259,7 +259,7 @@ extern int tar_main(int argc, char **argv) | |||
259 | break; | 259 | break; |
260 | case 'f': | 260 | case 'f': |
261 | if (*tarName != '-') | 261 | if (*tarName != '-') |
262 | error_msg_and_die( "Only one 'f' option allowed\n"); | 262 | error_msg_and_die( "Only one 'f' option allowed"); |
263 | tarName = optarg; | 263 | tarName = optarg; |
264 | break; | 264 | break; |
265 | #if defined BB_FEATURE_TAR_EXCLUDE | 265 | #if defined BB_FEATURE_TAR_EXCLUDE |
@@ -294,11 +294,11 @@ extern int tar_main(int argc, char **argv) | |||
294 | */ | 294 | */ |
295 | if (createFlag == TRUE) { | 295 | if (createFlag == TRUE) { |
296 | #ifndef BB_FEATURE_TAR_CREATE | 296 | #ifndef BB_FEATURE_TAR_CREATE |
297 | error_msg_and_die( "This version of tar was not compiled with tar creation support.\n"); | 297 | error_msg_and_die( "This version of tar was not compiled with tar creation support."); |
298 | #else | 298 | #else |
299 | #ifdef BB_FEATURE_TAR_GZIP | 299 | #ifdef BB_FEATURE_TAR_GZIP |
300 | if (unzipFlag==TRUE) | 300 | if (unzipFlag==TRUE) |
301 | error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip\n"); | 301 | error_msg_and_die("Creation of compressed not internally support by tar, pipe to busybox gunzip"); |
302 | #endif | 302 | #endif |
303 | status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList); | 303 | status = writeTarFile(tarName, verboseFlag, argv + optind, excludeList); |
304 | #endif | 304 | #endif |
@@ -330,7 +330,7 @@ extern int tar_main(int argc, char **argv) | |||
330 | return EXIT_FAILURE; | 330 | return EXIT_FAILURE; |
331 | 331 | ||
332 | flagError: | 332 | flagError: |
333 | error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified\n"); | 333 | error_msg_and_die( "Exactly one of 'c', 'x' or 't' must be specified"); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void | 336 | static void |
@@ -383,7 +383,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
383 | } | 383 | } |
384 | if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) { | 384 | if ( (readSize = full_read(header->tarFd, buffer, readSize)) <= 0 ) { |
385 | /* Tarball seems to have a problem */ | 385 | /* Tarball seems to have a problem */ |
386 | error_msg("Unexpected EOF in archive\n"); | 386 | error_msg("Unexpected EOF in archive"); |
387 | return( FALSE); | 387 | return( FALSE); |
388 | } | 388 | } |
389 | if ( readSize < writeSize ) | 389 | if ( readSize < writeSize ) |
@@ -476,7 +476,7 @@ tarExtractSymLink(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
476 | /* Do not change permissions or date on symlink, | 476 | /* Do not change permissions or date on symlink, |
477 | * since it changes the pointed to file instead. duh. */ | 477 | * since it changes the pointed to file instead. duh. */ |
478 | #else | 478 | #else |
479 | error_msg("%s: Cannot create symlink to '%s': %s\n", | 479 | error_msg("%s: Cannot create symlink to '%s': %s", |
480 | header->name, header->linkname, | 480 | header->name, header->linkname, |
481 | "symlinks not supported"); | 481 | "symlinks not supported"); |
482 | #endif | 482 | #endif |
@@ -543,7 +543,7 @@ readTarHeader(struct TarHeader *rawHeader, struct TarInfo *header) | |||
543 | ++*(header->name); | 543 | ++*(header->name); |
544 | 544 | ||
545 | if (alreadyWarned == FALSE) { | 545 | if (alreadyWarned == FALSE) { |
546 | error_msg("Removing leading '/' from member names\n"); | 546 | error_msg("Removing leading '/' from member names"); |
547 | alreadyWarned = TRUE; | 547 | alreadyWarned = TRUE; |
548 | } | 548 | } |
549 | } | 549 | } |
@@ -644,7 +644,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
644 | goto endgame; | 644 | goto endgame; |
645 | } else { | 645 | } else { |
646 | errorFlag=TRUE; | 646 | errorFlag=TRUE; |
647 | error_msg("Bad tar header, skipping\n"); | 647 | error_msg("Bad tar header, skipping"); |
648 | continue; | 648 | continue; |
649 | } | 649 | } |
650 | } | 650 | } |
@@ -791,7 +791,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
791 | break; | 791 | break; |
792 | #endif | 792 | #endif |
793 | default: | 793 | default: |
794 | error_msg("Unknown file type '%c' in tar file\n", header.type); | 794 | error_msg("Unknown file type '%c' in tar file", header.type); |
795 | close( tarFd); | 795 | close( tarFd); |
796 | return( FALSE); | 796 | return( FALSE); |
797 | } | 797 | } |
@@ -803,7 +803,7 @@ extern int readTarFile(int tarFd, int extractFlag, int listFlag, | |||
803 | return ( FALSE); | 803 | return ( FALSE); |
804 | } | 804 | } |
805 | else if (errorFlag==TRUE) { | 805 | else if (errorFlag==TRUE) { |
806 | error_msg( "Error exit delayed from previous errors\n"); | 806 | error_msg( "Error exit delayed from previous errors"); |
807 | return( FALSE); | 807 | return( FALSE); |
808 | } else | 808 | } else |
809 | return( status); | 809 | return( status); |
@@ -813,7 +813,7 @@ endgame: | |||
813 | close( tarFd); | 813 | close( tarFd); |
814 | if ( *(header.name) == '\0' ) { | 814 | if ( *(header.name) == '\0' ) { |
815 | if (errorFlag==TRUE) | 815 | if (errorFlag==TRUE) |
816 | error_msg( "Error exit delayed from previous errors\n"); | 816 | error_msg( "Error exit delayed from previous errors"); |
817 | else | 817 | else |
818 | return( TRUE); | 818 | return( TRUE); |
819 | } | 819 | } |
@@ -1002,7 +1002,7 @@ writeTarHeader(struct TarBallInfo *tbInfo, const char *header_name, | |||
1002 | header.typeflag = REGTYPE; | 1002 | header.typeflag = REGTYPE; |
1003 | putOctal(header.size, sizeof(header.size), statbuf->st_size); | 1003 | putOctal(header.size, sizeof(header.size), statbuf->st_size); |
1004 | } else { | 1004 | } else { |
1005 | error_msg("%s: Unknown file type\n", real_name); | 1005 | error_msg("%s: Unknown file type", real_name); |
1006 | return ( FALSE); | 1006 | return ( FALSE); |
1007 | } | 1007 | } |
1008 | 1008 | ||
@@ -1061,7 +1061,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1061 | 1061 | ||
1062 | /* It is against the rules to archive a socket */ | 1062 | /* It is against the rules to archive a socket */ |
1063 | if (S_ISSOCK(statbuf->st_mode)) { | 1063 | if (S_ISSOCK(statbuf->st_mode)) { |
1064 | error_msg("%s: socket ignored\n", fileName); | 1064 | error_msg("%s: socket ignored", fileName); |
1065 | return( TRUE); | 1065 | return( TRUE); |
1066 | } | 1066 | } |
1067 | 1067 | ||
@@ -1070,7 +1070,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1070 | * the new tarball */ | 1070 | * the new tarball */ |
1071 | if (tbInfo->statBuf.st_dev == statbuf->st_dev && | 1071 | if (tbInfo->statBuf.st_dev == statbuf->st_dev && |
1072 | tbInfo->statBuf.st_ino == statbuf->st_ino) { | 1072 | tbInfo->statBuf.st_ino == statbuf->st_ino) { |
1073 | error_msg("%s: file is the archive; skipping\n", fileName); | 1073 | error_msg("%s: file is the archive; skipping", fileName); |
1074 | return( TRUE); | 1074 | return( TRUE); |
1075 | } | 1075 | } |
1076 | 1076 | ||
@@ -1078,7 +1078,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1078 | while (header_name[0] == '/') { | 1078 | while (header_name[0] == '/') { |
1079 | static int alreadyWarned=FALSE; | 1079 | static int alreadyWarned=FALSE; |
1080 | if (alreadyWarned==FALSE) { | 1080 | if (alreadyWarned==FALSE) { |
1081 | error_msg("Removing leading '/' from member names\n"); | 1081 | error_msg("Removing leading '/' from member names"); |
1082 | alreadyWarned=TRUE; | 1082 | alreadyWarned=TRUE; |
1083 | } | 1083 | } |
1084 | header_name++; | 1084 | header_name++; |
@@ -1111,7 +1111,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, void* | |||
1111 | 1111 | ||
1112 | /* open the file we want to archive, and make sure all is well */ | 1112 | /* open the file we want to archive, and make sure all is well */ |
1113 | if ((inputFileFd = open(fileName, O_RDONLY)) < 0) { | 1113 | if ((inputFileFd = open(fileName, O_RDONLY)) < 0) { |
1114 | error_msg("%s: Cannot open: %s\n", fileName, strerror(errno)); | 1114 | error_msg("%s: Cannot open: %s", fileName, strerror(errno)); |
1115 | return( FALSE); | 1115 | return( FALSE); |
1116 | } | 1116 | } |
1117 | 1117 | ||
@@ -1150,7 +1150,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
1150 | 1150 | ||
1151 | /* Make sure there is at least one file to tar up. */ | 1151 | /* Make sure there is at least one file to tar up. */ |
1152 | if (*argv == NULL) | 1152 | if (*argv == NULL) |
1153 | error_msg_and_die("Cowardly refusing to create an empty archive\n"); | 1153 | error_msg_and_die("Cowardly refusing to create an empty archive"); |
1154 | 1154 | ||
1155 | /* Open the tar file for writing. */ | 1155 | /* Open the tar file for writing. */ |
1156 | if (!strcmp(tarName, "-")) | 1156 | if (!strcmp(tarName, "-")) |
@@ -1193,7 +1193,7 @@ static int writeTarFile(const char* tarName, int verboseFlag, char **argv, | |||
1193 | /* Hang up the tools, close up shop, head home */ | 1193 | /* Hang up the tools, close up shop, head home */ |
1194 | close(tarFd); | 1194 | close(tarFd); |
1195 | if (errorFlag == TRUE) { | 1195 | if (errorFlag == TRUE) { |
1196 | error_msg("Error exit delayed from previous errors\n"); | 1196 | error_msg("Error exit delayed from previous errors"); |
1197 | freeHardLinkInfo(&tbInfo.hlInfoHead); | 1197 | freeHardLinkInfo(&tbInfo.hlInfoHead); |
1198 | return(FALSE); | 1198 | return(FALSE); |
1199 | } | 1199 | } |
@@ -584,7 +584,7 @@ static int getport(char * p) | |||
584 | 584 | ||
585 | if ((unsigned)(port - 1 ) > 65534) | 585 | if ((unsigned)(port - 1 ) > 65534) |
586 | { | 586 | { |
587 | error_msg_and_die("%s: bad port number\n", p); | 587 | error_msg_and_die("%s: bad port number", p); |
588 | } | 588 | } |
589 | return port; | 589 | return port; |
590 | } | 590 | } |
@@ -596,7 +596,7 @@ static struct in_addr getserver(char * host) | |||
596 | struct hostent * he; | 596 | struct hostent * he; |
597 | if ((he = gethostbyname(host)) == NULL) | 597 | if ((he = gethostbyname(host)) == NULL) |
598 | { | 598 | { |
599 | error_msg_and_die("%s: Unknown host\n", host); | 599 | error_msg_and_die("%s: Unknown host", host); |
600 | } | 600 | } |
601 | memcpy(&addr, he->h_addr, sizeof addr); | 601 | memcpy(&addr, he->h_addr, sizeof addr); |
602 | 602 | ||
@@ -184,7 +184,7 @@ test_main(int argc, char** argv) | |||
184 | 184 | ||
185 | if (strcmp(applet_name, "[") == 0) { | 185 | if (strcmp(applet_name, "[") == 0) { |
186 | if (strcmp(argv[--argc], "]")) | 186 | if (strcmp(argv[--argc], "]")) |
187 | error_msg_and_die("missing ]\n"); | 187 | error_msg_and_die("missing ]"); |
188 | argv[argc] = NULL; | 188 | argv[argc] = NULL; |
189 | } | 189 | } |
190 | /* Implement special cases from POSIX.2, section 4.62.4 */ | 190 | /* Implement special cases from POSIX.2, section 4.62.4 */ |
@@ -233,9 +233,9 @@ syntax(op, msg) | |||
233 | char *msg; | 233 | char *msg; |
234 | { | 234 | { |
235 | if (op && *op) | 235 | if (op && *op) |
236 | error_msg_and_die("%s: %s\n", op, msg); | 236 | error_msg_and_die("%s: %s", op, msg); |
237 | else | 237 | else |
238 | error_msg_and_die("%s\n", msg); | 238 | error_msg_and_die("%s", msg); |
239 | } | 239 | } |
240 | 240 | ||
241 | static int | 241 | static int |
@@ -470,13 +470,13 @@ getn(s) | |||
470 | r = strtol(s, &p, 10); | 470 | r = strtol(s, &p, 10); |
471 | 471 | ||
472 | if (errno != 0) | 472 | if (errno != 0) |
473 | error_msg_and_die("%s: out of range\n", s); | 473 | error_msg_and_die("%s: out of range", s); |
474 | 474 | ||
475 | while (isspace(*p)) | 475 | while (isspace(*p)) |
476 | p++; | 476 | p++; |
477 | 477 | ||
478 | if (*p) | 478 | if (*p) |
479 | error_msg_and_die("%s: bad number\n", s); | 479 | error_msg_and_die("%s: bad number", s); |
480 | 480 | ||
481 | return (int) r; | 481 | return (int) r; |
482 | } | 482 | } |
@@ -186,7 +186,7 @@ extern int tr_main(int argc, char **argv) | |||
186 | input_length = complement(input, input_length); | 186 | input_length = complement(input, input_length); |
187 | if (argv[index] != NULL) { | 187 | if (argv[index] != NULL) { |
188 | if (*argv[index] == '\0') | 188 | if (*argv[index] == '\0') |
189 | error_msg_and_die("STRING2 cannot be empty\n"); | 189 | error_msg_and_die("STRING2 cannot be empty"); |
190 | output_length = expand(argv[index], output); | 190 | output_length = expand(argv[index], output); |
191 | map(input, input_length, output, output_length); | 191 | map(input, input_length, output, output_length); |
192 | } | 192 | } |
@@ -81,7 +81,7 @@ void mtab_read(void) | |||
81 | return; | 81 | return; |
82 | 82 | ||
83 | if ((fp = setmntent(mtab_file, "r")) == NULL) { | 83 | if ((fp = setmntent(mtab_file, "r")) == NULL) { |
84 | error_msg("Cannot open %s\n", mtab_file); | 84 | error_msg("Cannot open %s", mtab_file); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | while ((e = getmntent(fp))) { | 87 | while ((e = getmntent(fp))) { |
@@ -181,7 +181,7 @@ static int do_umount(const char *name, int useMtab) | |||
181 | if (status != 0 && doForce == TRUE) { | 181 | if (status != 0 && doForce == TRUE) { |
182 | status = umount2(blockDevice, MNT_FORCE); | 182 | status = umount2(blockDevice, MNT_FORCE); |
183 | if (status != 0) { | 183 | if (status != 0) { |
184 | error_msg_and_die("forced umount of %s failed!\n", blockDevice); | 184 | error_msg_and_die("forced umount of %s failed!", blockDevice); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | #endif | 187 | #endif |
@@ -189,9 +189,9 @@ static int do_umount(const char *name, int useMtab) | |||
189 | status = mount(blockDevice, name, NULL, | 189 | status = mount(blockDevice, name, NULL, |
190 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); | 190 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); |
191 | if (status == 0) { | 191 | if (status == 0) { |
192 | error_msg("%s busy - remounted read-only\n", blockDevice); | 192 | error_msg("%s busy - remounted read-only", blockDevice); |
193 | } else { | 193 | } else { |
194 | error_msg("Cannot remount %s read-only\n", blockDevice); | 194 | error_msg("Cannot remount %s read-only", blockDevice); |
195 | } | 195 | } |
196 | } | 196 | } |
197 | if (status == 0) { | 197 | if (status == 0) { |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 637896bed..f20c284aa 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -284,7 +284,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn, | |||
284 | } | 284 | } |
285 | } | 285 | } |
286 | #else | 286 | #else |
287 | error_msg( "mode reading not compiled in\n"); | 287 | error_msg( "mode reading not compiled in"); |
288 | #endif | 288 | #endif |
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv) | |||
434 | perror_msg_and_die("fbset(ioctl)"); | 434 | perror_msg_and_die("fbset(ioctl)"); |
435 | if (g_options & OPT_READMODE) { | 435 | if (g_options & OPT_READMODE) { |
436 | if (!readmode(&var, modefile, mode)) { | 436 | if (!readmode(&var, modefile, mode)) { |
437 | error_msg("Unknown video mode `%s'\n", mode); | 437 | error_msg("Unknown video mode `%s'", mode); |
438 | return EXIT_FAILURE; | 438 | return EXIT_FAILURE; |
439 | } | 439 | } |
440 | } | 440 | } |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 18841ec56..9d7622006 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -290,7 +290,7 @@ static void show_usage(void) | |||
290 | 290 | ||
291 | static void die(const char *str) | 291 | static void die(const char *str) |
292 | { | 292 | { |
293 | error_msg("%s\n", str); | 293 | error_msg("%s", str); |
294 | leave(8); | 294 | leave(8); |
295 | } | 295 | } |
296 | 296 | ||
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index ff55a3e3c..625263184 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -258,7 +258,7 @@ void add_long_options(char *options) | |||
258 | arg_opt=required_argument; | 258 | arg_opt=required_argument; |
259 | } | 259 | } |
260 | if (strlen(tokptr) == 0) | 260 | if (strlen(tokptr) == 0) |
261 | error_msg("empty long option after -l or --long argument\n"); | 261 | error_msg("empty long option after -l or --long argument"); |
262 | } | 262 | } |
263 | add_longopt(tokptr,arg_opt); | 263 | add_longopt(tokptr,arg_opt); |
264 | } | 264 | } |
@@ -277,7 +277,7 @@ void set_shell(const char *new_shell) | |||
277 | else if (!strcmp(new_shell,"csh")) | 277 | else if (!strcmp(new_shell,"csh")) |
278 | shell=TCSH; | 278 | shell=TCSH; |
279 | else | 279 | else |
280 | error_msg("unknown shell after -s or --shell argument\n"); | 280 | error_msg("unknown shell after -s or --shell argument"); |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[]) | |||
326 | printf(" --\n"); | 326 | printf(" --\n"); |
327 | exit(0); | 327 | exit(0); |
328 | } else | 328 | } else |
329 | error_msg_and_die("missing optstring argument\n"); | 329 | error_msg_and_die("missing optstring argument"); |
330 | } | 330 | } |
331 | 331 | ||
332 | if (argv[1][0] != '-' || compatible) { | 332 | if (argv[1][0] != '-' || compatible) { |
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[]) | |||
377 | 377 | ||
378 | if (!optstr) { | 378 | if (!optstr) { |
379 | if (optind >= argc) | 379 | if (optind >= argc) |
380 | error_msg_and_die("missing optstring argument\n"); | 380 | error_msg_and_die("missing optstring argument"); |
381 | else { | 381 | else { |
382 | optstr=xmalloc(strlen(argv[optind])+1); | 382 | optstr=xmalloc(strlen(argv[optind])+1); |
383 | strcpy(optstr,argv[optind]); | 383 | strcpy(optstr,argv[optind]); |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 21965d3b1..a2b6d8a6e 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -279,7 +279,7 @@ static void check_mount(void) | |||
279 | if (!mnt) | 279 | if (!mnt) |
280 | return; | 280 | return; |
281 | 281 | ||
282 | error_msg_and_die("%s is mounted; will not make a filesystem here!\n", device_name); | 282 | error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name); |
283 | } | 283 | } |
284 | 284 | ||
285 | static long valid_offset(int fd, int offset) | 285 | static long valid_offset(int fd, int offset) |
@@ -336,28 +336,28 @@ static void write_tables(void) | |||
336 | Super.s_state &= ~MINIX_ERROR_FS; | 336 | Super.s_state &= ~MINIX_ERROR_FS; |
337 | 337 | ||
338 | if (lseek(DEV, 0, SEEK_SET)) | 338 | if (lseek(DEV, 0, SEEK_SET)) |
339 | error_msg_and_die("seek to boot block failed in write_tables\n"); | 339 | error_msg_and_die("seek to boot block failed in write_tables"); |
340 | if (512 != write(DEV, boot_block_buffer, 512)) | 340 | if (512 != write(DEV, boot_block_buffer, 512)) |
341 | error_msg_and_die("unable to clear boot sector\n"); | 341 | error_msg_and_die("unable to clear boot sector"); |
342 | if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET)) | 342 | if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET)) |
343 | error_msg_and_die("seek failed in write_tables\n"); | 343 | error_msg_and_die("seek failed in write_tables"); |
344 | if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE)) | 344 | if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE)) |
345 | error_msg_and_die("unable to write super-block\n"); | 345 | error_msg_and_die("unable to write super-block"); |
346 | if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE)) | 346 | if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE)) |
347 | error_msg_and_die("unable to write inode map\n"); | 347 | error_msg_and_die("unable to write inode map"); |
348 | if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE)) | 348 | if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE)) |
349 | error_msg_and_die("unable to write zone map\n"); | 349 | error_msg_and_die("unable to write zone map"); |
350 | if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE)) | 350 | if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE)) |
351 | error_msg_and_die("unable to write inodes\n"); | 351 | error_msg_and_die("unable to write inodes"); |
352 | 352 | ||
353 | } | 353 | } |
354 | 354 | ||
355 | static void write_block(int blk, char *buffer) | 355 | static void write_block(int blk, char *buffer) |
356 | { | 356 | { |
357 | if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET)) | 357 | if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET)) |
358 | error_msg_and_die("seek failed in write_block\n"); | 358 | error_msg_and_die("seek failed in write_block"); |
359 | if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE)) | 359 | if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE)) |
360 | error_msg_and_die("write failed in write_block\n"); | 360 | error_msg_and_die("write failed in write_block"); |
361 | } | 361 | } |
362 | 362 | ||
363 | static int get_free_block(void) | 363 | static int get_free_block(void) |
@@ -365,7 +365,7 @@ static int get_free_block(void) | |||
365 | int blk; | 365 | int blk; |
366 | 366 | ||
367 | if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS) | 367 | if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS) |
368 | error_msg_and_die("too many bad blocks\n"); | 368 | error_msg_and_die("too many bad blocks"); |
369 | if (used_good_blocks) | 369 | if (used_good_blocks) |
370 | blk = good_blocks_table[used_good_blocks - 1] + 1; | 370 | blk = good_blocks_table[used_good_blocks - 1] + 1; |
371 | else | 371 | else |
@@ -373,7 +373,7 @@ static int get_free_block(void) | |||
373 | while (blk < ZONES && zone_in_use(blk)) | 373 | while (blk < ZONES && zone_in_use(blk)) |
374 | blk++; | 374 | blk++; |
375 | if (blk >= ZONES) | 375 | if (blk >= ZONES) |
376 | error_msg_and_die("not enough good blocks\n"); | 376 | error_msg_and_die("not enough good blocks"); |
377 | good_blocks_table[used_good_blocks] = blk; | 377 | good_blocks_table[used_good_blocks] = blk; |
378 | used_good_blocks++; | 378 | used_good_blocks++; |
379 | return blk; | 379 | return blk; |
@@ -439,7 +439,7 @@ static void make_bad_inode(void) | |||
439 | goto end_bad; | 439 | goto end_bad; |
440 | } | 440 | } |
441 | } | 441 | } |
442 | error_msg_and_die("too many bad blocks\n"); | 442 | error_msg_and_die("too many bad blocks"); |
443 | end_bad: | 443 | end_bad: |
444 | if (ind) | 444 | if (ind) |
445 | write_block(ind, (char *) ind_block); | 445 | write_block(ind, (char *) ind_block); |
@@ -489,7 +489,7 @@ static void make_bad_inode2(void) | |||
489 | } | 489 | } |
490 | } | 490 | } |
491 | /* Could make triple indirect block here */ | 491 | /* Could make triple indirect block here */ |
492 | error_msg_and_die("too many bad blocks\n"); | 492 | error_msg_and_die("too many bad blocks"); |
493 | end_bad: | 493 | end_bad: |
494 | if (ind) | 494 | if (ind) |
495 | write_block(ind, (char *) ind_block); | 495 | write_block(ind, (char *) ind_block); |
@@ -590,7 +590,7 @@ static void setup_tables(void) | |||
590 | * /sbin/mkfs.minix -i 200 test.fs | 590 | * /sbin/mkfs.minix -i 200 test.fs |
591 | * */ | 591 | * */ |
592 | if (i >= 999) { | 592 | if (i >= 999) { |
593 | error_msg_and_die("unable to allocate buffers for maps\n"); | 593 | error_msg_and_die("unable to allocate buffers for maps"); |
594 | } | 594 | } |
595 | FIRSTZONE = NORM_FIRSTZONE; | 595 | FIRSTZONE = NORM_FIRSTZONE; |
596 | inode_map = xmalloc(IMAPS * BLOCK_SIZE); | 596 | inode_map = xmalloc(IMAPS * BLOCK_SIZE); |
@@ -621,7 +621,7 @@ long do_check(char *buffer, int try, unsigned int current_block) | |||
621 | /* Seek to the correct loc. */ | 621 | /* Seek to the correct loc. */ |
622 | if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) != | 622 | if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) != |
623 | current_block * BLOCK_SIZE) { | 623 | current_block * BLOCK_SIZE) { |
624 | error_msg_and_die("seek failed during testing of blocks\n"); | 624 | error_msg_and_die("seek failed during testing of blocks"); |
625 | } | 625 | } |
626 | 626 | ||
627 | 627 | ||
@@ -661,7 +661,7 @@ static void check_blocks(void) | |||
661 | while (currently_testing < ZONES) { | 661 | while (currently_testing < ZONES) { |
662 | if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) != | 662 | if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) != |
663 | currently_testing * BLOCK_SIZE) | 663 | currently_testing * BLOCK_SIZE) |
664 | error_msg_and_die("seek failed in check_blocks\n"); | 664 | error_msg_and_die("seek failed in check_blocks"); |
665 | try = TEST_BUFFER_BLOCKS; | 665 | try = TEST_BUFFER_BLOCKS; |
666 | if (currently_testing + try > ZONES) | 666 | if (currently_testing + try > ZONES) |
667 | try = ZONES - currently_testing; | 667 | try = ZONES - currently_testing; |
@@ -670,7 +670,7 @@ static void check_blocks(void) | |||
670 | if (got == try) | 670 | if (got == try) |
671 | continue; | 671 | continue; |
672 | if (currently_testing < FIRSTZONE) | 672 | if (currently_testing < FIRSTZONE) |
673 | error_msg_and_die("bad blocks before data-area: cannot make fs\n"); | 673 | error_msg_and_die("bad blocks before data-area: cannot make fs"); |
674 | mark_zone(currently_testing); | 674 | mark_zone(currently_testing); |
675 | badblocks++; | 675 | badblocks++; |
676 | currently_testing++; | 676 | currently_testing++; |
@@ -690,7 +690,7 @@ char *filename; | |||
690 | 690 | ||
691 | listfile = fopen(filename, "r"); | 691 | listfile = fopen(filename, "r"); |
692 | if (listfile == (FILE *) NULL) { | 692 | if (listfile == (FILE *) NULL) { |
693 | error_msg_and_die("can't open file of bad blocks\n"); | 693 | error_msg_and_die("can't open file of bad blocks"); |
694 | } | 694 | } |
695 | while (!feof(listfile)) { | 695 | while (!feof(listfile)) { |
696 | fscanf(listfile, "%ld\n", &blockno); | 696 | fscanf(listfile, "%ld\n", &blockno); |
@@ -712,10 +712,10 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
712 | int stopIt=FALSE; | 712 | int stopIt=FALSE; |
713 | 713 | ||
714 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) | 714 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) |
715 | error_msg_and_die("bad inode size\n"); | 715 | error_msg_and_die("bad inode size"); |
716 | #ifdef BB_FEATURE_MINIX2 | 716 | #ifdef BB_FEATURE_MINIX2 |
717 | if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) | 717 | if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) |
718 | error_msg_and_die("bad inode size\n"); | 718 | error_msg_and_die("bad inode size"); |
719 | #endif | 719 | #endif |
720 | 720 | ||
721 | /* Parse options */ | 721 | /* Parse options */ |
@@ -781,7 +781,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
781 | #ifdef BB_FEATURE_MINIX2 | 781 | #ifdef BB_FEATURE_MINIX2 |
782 | version2 = 1; | 782 | version2 = 1; |
783 | #else | 783 | #else |
784 | error_msg("%s: not compiled with minix v2 support\n", | 784 | error_msg("%s: not compiled with minix v2 support", |
785 | device_name); | 785 | device_name); |
786 | exit(-1); | 786 | exit(-1); |
787 | #endif | 787 | #endif |
@@ -832,13 +832,13 @@ goodbye: | |||
832 | strcpy(tmp + 2, ".badblocks"); | 832 | strcpy(tmp + 2, ".badblocks"); |
833 | DEV = open(device_name, O_RDWR); | 833 | DEV = open(device_name, O_RDWR); |
834 | if (DEV < 0) | 834 | if (DEV < 0) |
835 | error_msg_and_die("unable to open %s\n", device_name); | 835 | error_msg_and_die("unable to open %s", device_name); |
836 | if (fstat(DEV, &statbuf) < 0) | 836 | if (fstat(DEV, &statbuf) < 0) |
837 | error_msg_and_die("unable to stat %s\n", device_name); | 837 | error_msg_and_die("unable to stat %s", device_name); |
838 | if (!S_ISBLK(statbuf.st_mode)) | 838 | if (!S_ISBLK(statbuf.st_mode)) |
839 | check = 0; | 839 | check = 0; |
840 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) | 840 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) |
841 | error_msg_and_die("will not try to make filesystem on '%s'\n", device_name); | 841 | error_msg_and_die("will not try to make filesystem on '%s'", device_name); |
842 | setup_tables(); | 842 | setup_tables(); |
843 | if (check) | 843 | if (check) |
844 | check_blocks(); | 844 | check_blocks(); |
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index 8a3c900f3..7d690ad99 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
@@ -87,7 +87,7 @@ static void init_signature_page() | |||
87 | 87 | ||
88 | #ifdef PAGE_SIZE | 88 | #ifdef PAGE_SIZE |
89 | if (pagesize != PAGE_SIZE) | 89 | if (pagesize != PAGE_SIZE) |
90 | error_msg("Assuming pages of size %d\n", pagesize); | 90 | error_msg("Assuming pages of size %d", pagesize); |
91 | #endif | 91 | #endif |
92 | signature_page = (int *) xmalloc(pagesize); | 92 | signature_page = (int *) xmalloc(pagesize); |
93 | memset(signature_page, 0, pagesize); | 93 | memset(signature_page, 0, pagesize); |
@@ -185,7 +185,7 @@ static void page_bad(int page) | |||
185 | bit_test_and_clear(signature_page, page); | 185 | bit_test_and_clear(signature_page, page); |
186 | else { | 186 | else { |
187 | if (badpages == MAX_BADPAGES) | 187 | if (badpages == MAX_BADPAGES) |
188 | error_msg_and_die("too many bad pages\n"); | 188 | error_msg_and_die("too many bad pages"); |
189 | p->badpages[badpages] = page; | 189 | p->badpages[badpages] = page; |
190 | } | 190 | } |
191 | badpages++; | 191 | badpages++; |
@@ -206,7 +206,7 @@ static void check_blocks(void) | |||
206 | } | 206 | } |
207 | if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) != | 207 | if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) != |
208 | current_page * pagesize) | 208 | current_page * pagesize) |
209 | error_msg_and_die("seek failed in check_blocks\n"); | 209 | error_msg_and_die("seek failed in check_blocks"); |
210 | if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) { | 210 | if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) { |
211 | page_bad(current_page++); | 211 | page_bad(current_page++); |
212 | continue; | 212 | continue; |
@@ -307,14 +307,14 @@ int mkswap_main(int argc, char **argv) | |||
307 | } | 307 | } |
308 | } | 308 | } |
309 | if (!device_name) { | 309 | if (!device_name) { |
310 | error_msg("error: Nowhere to set up swap on?\n"); | 310 | error_msg("error: Nowhere to set up swap on?"); |
311 | usage(mkswap_usage); | 311 | usage(mkswap_usage); |
312 | } | 312 | } |
313 | sz = get_size(device_name); | 313 | sz = get_size(device_name); |
314 | if (!PAGES) { | 314 | if (!PAGES) { |
315 | PAGES = sz; | 315 | PAGES = sz; |
316 | } else if (PAGES > sz && !force) { | 316 | } else if (PAGES > sz && !force) { |
317 | error_msg("error: size %ld is larger than device size %d\n", | 317 | error_msg("error: size %ld is larger than device size %d", |
318 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); | 318 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); |
319 | return EXIT_FAILURE; | 319 | return EXIT_FAILURE; |
320 | } | 320 | } |
@@ -330,11 +330,11 @@ int mkswap_main(int argc, char **argv) | |||
330 | version = 1; | 330 | version = 1; |
331 | } | 331 | } |
332 | if (version != 0 && version != 1) { | 332 | if (version != 0 && version != 1) { |
333 | error_msg("error: unknown version %d\n", version); | 333 | error_msg("error: unknown version %d", version); |
334 | usage(mkswap_usage); | 334 | usage(mkswap_usage); |
335 | } | 335 | } |
336 | if (PAGES < 10) { | 336 | if (PAGES < 10) { |
337 | error_msg("error: swap area needs to be at least %ldkB\n", | 337 | error_msg("error: swap area needs to be at least %ldkB", |
338 | (long) (10 * pagesize / 1024)); | 338 | (long) (10 * pagesize / 1024)); |
339 | usage(mkswap_usage); | 339 | usage(mkswap_usage); |
340 | } | 340 | } |
@@ -353,7 +353,7 @@ int mkswap_main(int argc, char **argv) | |||
353 | #endif | 353 | #endif |
354 | if (PAGES > maxpages) { | 354 | if (PAGES > maxpages) { |
355 | PAGES = maxpages; | 355 | PAGES = maxpages; |
356 | error_msg("warning: truncating swap area to %ldkB\n", | 356 | error_msg("warning: truncating swap area to %ldkB", |
357 | PAGES * pagesize / 1024); | 357 | PAGES * pagesize / 1024); |
358 | } | 358 | } |
359 | 359 | ||
@@ -363,7 +363,7 @@ int mkswap_main(int argc, char **argv) | |||
363 | if (!S_ISBLK(statbuf.st_mode)) | 363 | if (!S_ISBLK(statbuf.st_mode)) |
364 | check = 0; | 364 | check = 0; |
365 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) | 365 | else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340) |
366 | error_msg_and_die("Will not try to make swapdevice on '%s'\n", device_name); | 366 | error_msg_and_die("Will not try to make swapdevice on '%s'", device_name); |
367 | 367 | ||
368 | #ifdef __sparc__ | 368 | #ifdef __sparc__ |
369 | if (!force && version == 0) { | 369 | if (!force && version == 0) { |
@@ -372,7 +372,7 @@ int mkswap_main(int argc, char **argv) | |||
372 | unsigned short *q, sum; | 372 | unsigned short *q, sum; |
373 | 373 | ||
374 | if (read(DEV, buffer, 512) != 512) | 374 | if (read(DEV, buffer, 512) != 512) |
375 | error_msg_and_die("fatal: first page unreadable\n"); | 375 | error_msg_and_die("fatal: first page unreadable"); |
376 | if (buffer[508] == 0xDA && buffer[509] == 0xBE) { | 376 | if (buffer[508] == 0xDA && buffer[509] == 0xBE) { |
377 | q = (unsigned short *) (buffer + 510); | 377 | q = (unsigned short *) (buffer + 510); |
378 | for (sum = 0; q >= (unsigned short *) buffer;) | 378 | for (sum = 0; q >= (unsigned short *) buffer;) |
@@ -381,7 +381,7 @@ int mkswap_main(int argc, char **argv) | |||
381 | error_msg("Device '%s' contains a valid Sun disklabel.\n" | 381 | error_msg("Device '%s' contains a valid Sun disklabel.\n" |
382 | "This probably means creating v0 swap would destroy your partition table\n" | 382 | "This probably means creating v0 swap would destroy your partition table\n" |
383 | "No swap created. If you really want to create swap v0 on that device, use\n" | 383 | "No swap created. If you really want to create swap v0 on that device, use\n" |
384 | "the -f option to force it.\n", device_name); | 384 | "the -f option to force it.", device_name); |
385 | return EXIT_FAILURE; | 385 | return EXIT_FAILURE; |
386 | } | 386 | } |
387 | } | 387 | } |
@@ -391,7 +391,7 @@ int mkswap_main(int argc, char **argv) | |||
391 | if (version == 0 || check) | 391 | if (version == 0 || check) |
392 | check_blocks(); | 392 | check_blocks(); |
393 | if (version == 0 && !bit_test_and_clear(signature_page, 0)) | 393 | if (version == 0 && !bit_test_and_clear(signature_page, 0)) |
394 | error_msg_and_die("fatal: first page unreadable\n"); | 394 | error_msg_and_die("fatal: first page unreadable"); |
395 | if (version == 1) { | 395 | if (version == 1) { |
396 | p->version = version; | 396 | p->version = version; |
397 | p->last_page = PAGES - 1; | 397 | p->last_page = PAGES - 1; |
@@ -400,23 +400,23 @@ int mkswap_main(int argc, char **argv) | |||
400 | 400 | ||
401 | goodpages = PAGES - badpages - 1; | 401 | goodpages = PAGES - badpages - 1; |
402 | if (goodpages <= 0) | 402 | if (goodpages <= 0) |
403 | error_msg_and_die("Unable to set up swap-space: unreadable\n"); | 403 | error_msg_and_die("Unable to set up swap-space: unreadable"); |
404 | printf("Setting up swapspace version %d, size = %ld bytes\n", | 404 | printf("Setting up swapspace version %d, size = %ld bytes\n", |
405 | version, (long) (goodpages * pagesize)); | 405 | version, (long) (goodpages * pagesize)); |
406 | write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2"); | 406 | write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2"); |
407 | 407 | ||
408 | offset = ((version == 0) ? 0 : 1024); | 408 | offset = ((version == 0) ? 0 : 1024); |
409 | if (lseek(DEV, offset, SEEK_SET) != offset) | 409 | if (lseek(DEV, offset, SEEK_SET) != offset) |
410 | error_msg_and_die("unable to rewind swap-device\n"); | 410 | error_msg_and_die("unable to rewind swap-device"); |
411 | if (write(DEV, (char *) signature_page + offset, pagesize - offset) | 411 | if (write(DEV, (char *) signature_page + offset, pagesize - offset) |
412 | != pagesize - offset) | 412 | != pagesize - offset) |
413 | error_msg_and_die("unable to write signature page\n"); | 413 | error_msg_and_die("unable to write signature page"); |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * A subsequent swapon() will fail if the signature | 416 | * A subsequent swapon() will fail if the signature |
417 | * is not actually on disk. (This is a kernel bug.) | 417 | * is not actually on disk. (This is a kernel bug.) |
418 | */ | 418 | */ |
419 | if (fsync(DEV)) | 419 | if (fsync(DEV)) |
420 | error_msg_and_die("fsync failed\n"); | 420 | error_msg_and_die("fsync failed"); |
421 | return EXIT_SUCCESS; | 421 | return EXIT_SUCCESS; |
422 | } | 422 | } |
diff --git a/util-linux/mount.c b/util-linux/mount.c index f78786ebc..b571e5035 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -132,20 +132,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, | |||
132 | 132 | ||
133 | specialfile = find_unused_loop_device(); | 133 | specialfile = find_unused_loop_device(); |
134 | if (specialfile == NULL) { | 134 | if (specialfile == NULL) { |
135 | error_msg_and_die("Could not find a spare loop device\n"); | 135 | error_msg_and_die("Could not find a spare loop device"); |
136 | } | 136 | } |
137 | if (set_loop(specialfile, lofile, 0, &loro)) { | 137 | if (set_loop(specialfile, lofile, 0, &loro)) { |
138 | error_msg_and_die("Could not setup loop device\n"); | 138 | error_msg_and_die("Could not setup loop device"); |
139 | } | 139 | } |
140 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ | 140 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ |
141 | error_msg("WARNING: loop device is read-only\n"); | 141 | error_msg("WARNING: loop device is read-only"); |
142 | flags &= ~MS_RDONLY; | 142 | flags &= ~MS_RDONLY; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | #endif | 145 | #endif |
146 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); | 146 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); |
147 | if (errno == EROFS) { | 147 | if (errno == EROFS) { |
148 | error_msg("%s is write-protected, mounting read-only\n", specialfile); | 148 | error_msg("%s is write-protected, mounting read-only", specialfile); |
149 | status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags); | 149 | status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags); |
150 | } | 150 | } |
151 | } | 151 | } |
@@ -171,7 +171,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, | |||
171 | #endif | 171 | #endif |
172 | 172 | ||
173 | if (errno == EPERM) { | 173 | if (errno == EPERM) { |
174 | error_msg_and_die("permission denied. Are you root?\n"); | 174 | error_msg_and_die("permission denied. Are you root?"); |
175 | } | 175 | } |
176 | 176 | ||
177 | return (FALSE); | 177 | return (FALSE); |
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c index b260a885f..397858b71 100644 --- a/util-linux/nfsmount.c +++ b/util-linux/nfsmount.c | |||
@@ -307,7 +307,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
307 | msock = fsock = -1; | 307 | msock = fsock = -1; |
308 | mclient = NULL; | 308 | mclient = NULL; |
309 | if (strlen(spec) >= sizeof(hostdir)) { | 309 | if (strlen(spec) >= sizeof(hostdir)) { |
310 | error_msg("excessively long host:dir argument\n"); | 310 | error_msg("excessively long host:dir argument"); |
311 | goto fail; | 311 | goto fail; |
312 | } | 312 | } |
313 | strcpy(hostdir, spec); | 313 | strcpy(hostdir, spec); |
@@ -319,10 +319,10 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
319 | until they can be fully supported. (mack@sgi.com) */ | 319 | until they can be fully supported. (mack@sgi.com) */ |
320 | if ((s = strchr(hostdir, ','))) { | 320 | if ((s = strchr(hostdir, ','))) { |
321 | *s = '\0'; | 321 | *s = '\0'; |
322 | error_msg("warning: multiple hostnames not supported\n"); | 322 | error_msg("warning: multiple hostnames not supported"); |
323 | } | 323 | } |
324 | } else { | 324 | } else { |
325 | error_msg("directory to mount not in host:dir format\n"); | 325 | error_msg("directory to mount not in host:dir format"); |
326 | goto fail; | 326 | goto fail; |
327 | } | 327 | } |
328 | 328 | ||
@@ -332,11 +332,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
332 | #endif | 332 | #endif |
333 | { | 333 | { |
334 | if ((hp = gethostbyname(hostname)) == NULL) { | 334 | if ((hp = gethostbyname(hostname)) == NULL) { |
335 | error_msg("can't get address for %s\n", hostname); | 335 | error_msg("can't get address for %s", hostname); |
336 | goto fail; | 336 | goto fail; |
337 | } else { | 337 | } else { |
338 | if (hp->h_length > sizeof(struct in_addr)) { | 338 | if (hp->h_length > sizeof(struct in_addr)) { |
339 | error_msg("got bad hp->h_length\n"); | 339 | error_msg("got bad hp->h_length"); |
340 | hp->h_length = sizeof(struct in_addr); | 340 | hp->h_length = sizeof(struct in_addr); |
341 | } | 341 | } |
342 | memcpy(&server_addr.sin_addr, | 342 | memcpy(&server_addr.sin_addr, |
@@ -353,7 +353,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
353 | if (!old_opts) | 353 | if (!old_opts) |
354 | old_opts = ""; | 354 | old_opts = ""; |
355 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { | 355 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { |
356 | error_msg("excessively long option argument\n"); | 356 | error_msg("excessively long option argument"); |
357 | goto fail; | 357 | goto fail; |
358 | } | 358 | } |
359 | sprintf(new_opts, "%s%saddr=%s", | 359 | sprintf(new_opts, "%s%saddr=%s", |
@@ -513,11 +513,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
513 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); | 513 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); |
514 | #endif | 514 | #endif |
515 | if (nfsvers > MAX_NFSPROT) { | 515 | if (nfsvers > MAX_NFSPROT) { |
516 | error_msg("NFSv%d not supported!\n", nfsvers); | 516 | error_msg("NFSv%d not supported!", nfsvers); |
517 | return 0; | 517 | return 0; |
518 | } | 518 | } |
519 | if (mountvers > MAX_NFSPROT) { | 519 | if (mountvers > MAX_NFSPROT) { |
520 | error_msg("NFSv%d not supported!\n", nfsvers); | 520 | error_msg("NFSv%d not supported!", nfsvers); |
521 | return 0; | 521 | return 0; |
522 | } | 522 | } |
523 | if (nfsvers && !mountvers) | 523 | if (nfsvers && !mountvers) |
@@ -577,11 +577,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
577 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); | 577 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); |
578 | } else { | 578 | } else { |
579 | if ((hp = gethostbyname(mounthost)) == NULL) { | 579 | if ((hp = gethostbyname(mounthost)) == NULL) { |
580 | error_msg("can't get address for %s\n", hostname); | 580 | error_msg("can't get address for %s", hostname); |
581 | goto fail; | 581 | goto fail; |
582 | } else { | 582 | } else { |
583 | if (hp->h_length > sizeof(struct in_addr)) { | 583 | if (hp->h_length > sizeof(struct in_addr)) { |
584 | error_msg("got bad hp->h_length?\n"); | 584 | error_msg("got bad hp->h_length?"); |
585 | hp->h_length = sizeof(struct in_addr); | 585 | hp->h_length = sizeof(struct in_addr); |
586 | } | 586 | } |
587 | mount_server_addr.sin_family = AF_INET; | 587 | mount_server_addr.sin_family = AF_INET; |
@@ -716,7 +716,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
716 | 716 | ||
717 | if (nfsvers == 2) { | 717 | if (nfsvers == 2) { |
718 | if (status.nfsv2.fhs_status != 0) { | 718 | if (status.nfsv2.fhs_status != 0) { |
719 | error_msg("%s:%s failed, reason given by server: %s\n", | 719 | error_msg("%s:%s failed, reason given by server: %s", |
720 | hostname, dirname, | 720 | hostname, dirname, |
721 | nfs_strerror(status.nfsv2.fhs_status)); | 721 | nfs_strerror(status.nfsv2.fhs_status)); |
722 | goto fail; | 722 | goto fail; |
@@ -734,7 +734,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
734 | #if NFS_MOUNT_VERSION >= 4 | 734 | #if NFS_MOUNT_VERSION >= 4 |
735 | fhandle3 *fhandle; | 735 | fhandle3 *fhandle; |
736 | if (status.nfsv3.fhs_status != 0) { | 736 | if (status.nfsv3.fhs_status != 0) { |
737 | error_msg("%s:%s failed, reason given by server: %s\n", | 737 | error_msg("%s:%s failed, reason given by server: %s", |
738 | hostname, dirname, | 738 | hostname, dirname, |
739 | nfs_strerror(status.nfsv3.fhs_status)); | 739 | nfs_strerror(status.nfsv3.fhs_status)); |
740 | goto fail; | 740 | goto fail; |
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 0ad339be8..d350be877 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
@@ -72,7 +72,7 @@ time_t askremotedate(char *host) | |||
72 | } | 72 | } |
73 | if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */ | 73 | if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */ |
74 | close(fd); | 74 | close(fd); |
75 | error_msg("%s did not send the complete time\n", host); | 75 | error_msg("%s did not send the complete time", host); |
76 | } | 76 | } |
77 | close(fd); | 77 | close(fd); |
78 | 78 | ||
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 8a9134ca0..74f6ec36e 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
@@ -95,7 +95,7 @@ extern int swap_on_off_main(int argc, char **argv) | |||
95 | struct stat statBuf; | 95 | struct stat statBuf; |
96 | 96 | ||
97 | if (stat("/etc/fstab", &statBuf) < 0) | 97 | if (stat("/etc/fstab", &statBuf) < 0) |
98 | error_msg_and_die("/etc/fstab file missing\n"); | 98 | error_msg_and_die("/etc/fstab file missing"); |
99 | } | 99 | } |
100 | do_em_all(); | 100 | do_em_all(); |
101 | break; | 101 | break; |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 3772d55f0..39842d232 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -81,7 +81,7 @@ void mtab_read(void) | |||
81 | return; | 81 | return; |
82 | 82 | ||
83 | if ((fp = setmntent(mtab_file, "r")) == NULL) { | 83 | if ((fp = setmntent(mtab_file, "r")) == NULL) { |
84 | error_msg("Cannot open %s\n", mtab_file); | 84 | error_msg("Cannot open %s", mtab_file); |
85 | return; | 85 | return; |
86 | } | 86 | } |
87 | while ((e = getmntent(fp))) { | 87 | while ((e = getmntent(fp))) { |
@@ -181,7 +181,7 @@ static int do_umount(const char *name, int useMtab) | |||
181 | if (status != 0 && doForce == TRUE) { | 181 | if (status != 0 && doForce == TRUE) { |
182 | status = umount2(blockDevice, MNT_FORCE); | 182 | status = umount2(blockDevice, MNT_FORCE); |
183 | if (status != 0) { | 183 | if (status != 0) { |
184 | error_msg_and_die("forced umount of %s failed!\n", blockDevice); | 184 | error_msg_and_die("forced umount of %s failed!", blockDevice); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | #endif | 187 | #endif |
@@ -189,9 +189,9 @@ static int do_umount(const char *name, int useMtab) | |||
189 | status = mount(blockDevice, name, NULL, | 189 | status = mount(blockDevice, name, NULL, |
190 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); | 190 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); |
191 | if (status == 0) { | 191 | if (status == 0) { |
192 | error_msg("%s busy - remounted read-only\n", blockDevice); | 192 | error_msg("%s busy - remounted read-only", blockDevice); |
193 | } else { | 193 | } else { |
194 | error_msg("Cannot remount %s read-only\n", blockDevice); | 194 | error_msg("Cannot remount %s read-only", blockDevice); |
195 | } | 195 | } |
196 | } | 196 | } |
197 | if (status == 0) { | 197 | if (status == 0) { |
@@ -105,6 +105,7 @@ extern void error_msg(const char *s, ...) | |||
105 | va_start(p, s); | 105 | va_start(p, s); |
106 | verror_msg(s, p); | 106 | verror_msg(s, p); |
107 | va_end(p); | 107 | va_end(p); |
108 | putc('\n', stderr); | ||
108 | } | 109 | } |
109 | 110 | ||
110 | extern void error_msg_and_die(const char *s, ...) | 111 | extern void error_msg_and_die(const char *s, ...) |
@@ -114,6 +115,7 @@ extern void error_msg_and_die(const char *s, ...) | |||
114 | va_start(p, s); | 115 | va_start(p, s); |
115 | verror_msg(s, p); | 116 | verror_msg(s, p); |
116 | va_end(p); | 117 | va_end(p); |
118 | putc('\n', stderr); | ||
117 | exit(EXIT_FAILURE); | 119 | exit(EXIT_FAILURE); |
118 | } | 120 | } |
119 | 121 | ||
@@ -361,7 +363,7 @@ copy_file(const char *srcName, const char *destName, | |||
361 | 363 | ||
362 | if ((srcStatBuf.st_dev == dstStatBuf.st_dev) && | 364 | if ((srcStatBuf.st_dev == dstStatBuf.st_dev) && |
363 | (srcStatBuf.st_ino == dstStatBuf.st_ino)) { | 365 | (srcStatBuf.st_ino == dstStatBuf.st_ino)) { |
364 | error_msg("Copying file \"%s\" to itself\n", srcName); | 366 | error_msg("Copying file \"%s\" to itself", srcName); |
365 | return FALSE; | 367 | return FALSE; |
366 | } | 368 | } |
367 | 369 | ||
@@ -921,11 +923,11 @@ long my_getpwnamegid(char *name) | |||
921 | 923 | ||
922 | myuser=getpwnam(name); | 924 | myuser=getpwnam(name); |
923 | if (myuser==NULL) | 925 | if (myuser==NULL) |
924 | error_msg_and_die( "unknown user name: %s\n", name); | 926 | error_msg_and_die( "unknown user name: %s", name); |
925 | 927 | ||
926 | mygroup = getgrgid(myuser->pw_gid); | 928 | mygroup = getgrgid(myuser->pw_gid); |
927 | if (mygroup==NULL) | 929 | if (mygroup==NULL) |
928 | error_msg_and_die( "unknown gid %ld\n", (long)myuser->pw_gid); | 930 | error_msg_and_die( "unknown gid %ld", (long)myuser->pw_gid); |
929 | 931 | ||
930 | return mygroup->gr_gid; | 932 | return mygroup->gr_gid; |
931 | } | 933 | } |
@@ -1015,7 +1017,7 @@ int get_console_fd(char *tty_name) | |||
1015 | if (is_a_console(fd)) | 1017 | if (is_a_console(fd)) |
1016 | return fd; | 1018 | return fd; |
1017 | 1019 | ||
1018 | error_msg("Couldnt get a file descriptor referring to the console\n"); | 1020 | error_msg("Couldnt get a file descriptor referring to the console"); |
1019 | return -1; /* total failure */ | 1021 | return -1; /* total failure */ |
1020 | } | 1022 | } |
1021 | 1023 | ||
@@ -1374,7 +1376,7 @@ extern char * xstrndup (const char *s, int n) { | |||
1374 | char *t; | 1376 | char *t; |
1375 | 1377 | ||
1376 | if (s == NULL) | 1378 | if (s == NULL) |
1377 | error_msg_and_die("xstrndup bug\n"); | 1379 | error_msg_and_die("xstrndup bug"); |
1378 | 1380 | ||
1379 | t = xmalloc(n+1); | 1381 | t = xmalloc(n+1); |
1380 | strncpy(t,s,n); | 1382 | strncpy(t,s,n); |
@@ -1495,13 +1497,13 @@ extern int find_real_root_device_name(char* name) | |||
1495 | char fileName[BUFSIZ]; | 1497 | char fileName[BUFSIZ]; |
1496 | 1498 | ||
1497 | if (stat("/", &rootStat) != 0) { | 1499 | if (stat("/", &rootStat) != 0) { |
1498 | error_msg("could not stat '/'\n"); | 1500 | error_msg("could not stat '/'"); |
1499 | return( FALSE); | 1501 | return( FALSE); |
1500 | } | 1502 | } |
1501 | 1503 | ||
1502 | dir = opendir("/dev"); | 1504 | dir = opendir("/dev"); |
1503 | if (!dir) { | 1505 | if (!dir) { |
1504 | error_msg("could not open '/dev'\n"); | 1506 | error_msg("could not open '/dev'"); |
1505 | return( FALSE); | 1507 | return( FALSE); |
1506 | } | 1508 | } |
1507 | 1509 | ||
@@ -1660,7 +1662,7 @@ void xregcomp(regex_t *preg, const char *regex, int cflags) | |||
1660 | int errmsgsz = regerror(ret, preg, NULL, 0); | 1662 | int errmsgsz = regerror(ret, preg, NULL, 0); |
1661 | char *errmsg = xmalloc(errmsgsz); | 1663 | char *errmsg = xmalloc(errmsgsz); |
1662 | regerror(ret, preg, errmsg, errmsgsz); | 1664 | regerror(ret, preg, errmsg, errmsgsz); |
1663 | error_msg_and_die("xregcomp: %s\n", errmsg); | 1665 | error_msg_and_die("xregcomp: %s", errmsg); |
1664 | } | 1666 | } |
1665 | } | 1667 | } |
1666 | #endif | 1668 | #endif |
@@ -1707,7 +1709,7 @@ unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes) | |||
1707 | 1709 | ||
1708 | ret = strtoul(numstr, &end, 10); | 1710 | ret = strtoul(numstr, &end, 10); |
1709 | if (numstr == end) | 1711 | if (numstr == end) |
1710 | error_msg_and_die("invalid number `%s'\n", numstr); | 1712 | error_msg_and_die("invalid number `%s'", numstr); |
1711 | while (end[0] != '\0') { | 1713 | while (end[0] != '\0') { |
1712 | for (sm = suffixes; sm->suffix != NULL; sm++) { | 1714 | for (sm = suffixes; sm->suffix != NULL; sm++) { |
1713 | len = strlen(sm->suffix); | 1715 | len = strlen(sm->suffix); |
@@ -1718,7 +1720,7 @@ unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes) | |||
1718 | } | 1720 | } |
1719 | } | 1721 | } |
1720 | if (sm->suffix == NULL) | 1722 | if (sm->suffix == NULL) |
1721 | error_msg_and_die("invalid number `%s'\n", numstr); | 1723 | error_msg_and_die("invalid number `%s'", numstr); |
1722 | } | 1724 | } |
1723 | return ret; | 1725 | return ret; |
1724 | } | 1726 | } |
diff --git a/uudecode.c b/uudecode.c index fcfcfd903..cccc52872 100644 --- a/uudecode.c +++ b/uudecode.c | |||
@@ -46,7 +46,7 @@ static int read_stduu (const char *inname) | |||
46 | char *p; | 46 | char *p; |
47 | 47 | ||
48 | if (fgets (buf, sizeof(buf), stdin) == NULL) { | 48 | if (fgets (buf, sizeof(buf), stdin) == NULL) { |
49 | error_msg("%s: Short file\n", inname); | 49 | error_msg("%s: Short file", inname); |
50 | return FALSE; | 50 | return FALSE; |
51 | } | 51 | } |
52 | p = buf; | 52 | p = buf; |
@@ -81,7 +81,7 @@ static int read_stduu (const char *inname) | |||
81 | 81 | ||
82 | if (fgets (buf, sizeof(buf), stdin) == NULL | 82 | if (fgets (buf, sizeof(buf), stdin) == NULL |
83 | || strcmp (buf, "end\n")) { | 83 | || strcmp (buf, "end\n")) { |
84 | error_msg("%s: No `end' line\n", inname); | 84 | error_msg("%s: No `end' line", inname); |
85 | return FALSE; | 85 | return FALSE; |
86 | } | 86 | } |
87 | 87 | ||
@@ -131,7 +131,7 @@ static int read_base64 (const char *inname) | |||
131 | unsigned char *p; | 131 | unsigned char *p; |
132 | 132 | ||
133 | if (fgets (buf, sizeof(buf), stdin) == NULL) { | 133 | if (fgets (buf, sizeof(buf), stdin) == NULL) { |
134 | error_msg("%s: Short file\n", inname); | 134 | error_msg("%s: Short file", inname); |
135 | return FALSE; | 135 | return FALSE; |
136 | } | 136 | } |
137 | p = buf; | 137 | p = buf; |
@@ -139,7 +139,7 @@ static int read_base64 (const char *inname) | |||
139 | if (memcmp (buf, "====", 4) == 0) | 139 | if (memcmp (buf, "====", 4) == 0) |
140 | break; | 140 | break; |
141 | if (last_data != 0) { | 141 | if (last_data != 0) { |
142 | error_msg("%s: data following `=' padding character\n", inname); | 142 | error_msg("%s: data following `=' padding character", inname); |
143 | return FALSE; | 143 | return FALSE; |
144 | } | 144 | } |
145 | 145 | ||
@@ -161,14 +161,14 @@ static int read_base64 (const char *inname) | |||
161 | 161 | ||
162 | while ((b64_tab[*p] & '\100') != 0) | 162 | while ((b64_tab[*p] & '\100') != 0) |
163 | if (*p == '\n' || *p++ == '=') { | 163 | if (*p == '\n' || *p++ == '=') { |
164 | error_msg("%s: illegal line\n", inname); | 164 | error_msg("%s: illegal line", inname); |
165 | return FALSE; | 165 | return FALSE; |
166 | } | 166 | } |
167 | c2 = b64_tab[*p++]; | 167 | c2 = b64_tab[*p++]; |
168 | 168 | ||
169 | while (b64_tab[*p] == '\177') | 169 | while (b64_tab[*p] == '\177') |
170 | if (*p++ == '\n') { | 170 | if (*p++ == '\n') { |
171 | error_msg("%s: illegal line\n", inname); | 171 | error_msg("%s: illegal line", inname); |
172 | return FALSE; | 172 | return FALSE; |
173 | } | 173 | } |
174 | if (*p == '=') { | 174 | if (*p == '=') { |
@@ -180,7 +180,7 @@ static int read_base64 (const char *inname) | |||
180 | 180 | ||
181 | while (b64_tab[*p] == '\177') | 181 | while (b64_tab[*p] == '\177') |
182 | if (*p++ == '\n') { | 182 | if (*p++ == '\n') { |
183 | error_msg("%s: illegal line\n", inname); | 183 | error_msg("%s: illegal line", inname); |
184 | return FALSE; | 184 | return FALSE; |
185 | } | 185 | } |
186 | putchar (c1 << 2 | c2 >> 4); | 186 | putchar (c1 << 2 | c2 >> 4); |
@@ -212,7 +212,7 @@ static int decode (const char *inname, | |||
212 | 212 | ||
213 | while (1) { | 213 | while (1) { |
214 | if (fgets (buf, sizeof (buf), stdin) == NULL) { | 214 | if (fgets (buf, sizeof (buf), stdin) == NULL) { |
215 | error_msg("%s: No `begin' line\n", inname); | 215 | error_msg("%s: No `begin' line", inname); |
216 | return FALSE; | 216 | return FALSE; |
217 | } | 217 | } |
218 | 218 | ||
@@ -237,13 +237,13 @@ static int decode (const char *inname, | |||
237 | while (*p != '/') | 237 | while (*p != '/') |
238 | ++p; | 238 | ++p; |
239 | if (*p == '\0') { | 239 | if (*p == '\0') { |
240 | error_msg("%s: Illegal ~user\n", inname); | 240 | error_msg("%s: Illegal ~user", inname); |
241 | return FALSE; | 241 | return FALSE; |
242 | } | 242 | } |
243 | *p++ = '\0'; | 243 | *p++ = '\0'; |
244 | pw = getpwnam (buf + 1); | 244 | pw = getpwnam (buf + 1); |
245 | if (pw == NULL) { | 245 | if (pw == NULL) { |
246 | error_msg("%s: No user `%s'\n", inname, buf + 1); | 246 | error_msg("%s: No user `%s'", inname, buf + 1); |
247 | return FALSE; | 247 | return FALSE; |
248 | } | 248 | } |
249 | n = strlen (pw->pw_dir); | 249 | n = strlen (pw->pw_dir); |
diff --git a/uuencode.c b/uuencode.c index 5df49026b..73098ba26 100644 --- a/uuencode.c +++ b/uuencode.c | |||
@@ -142,7 +142,7 @@ static void encode() | |||
142 | } | 142 | } |
143 | 143 | ||
144 | if (ferror (stdin)) | 144 | if (ferror (stdin)) |
145 | error_msg("Read error\n"); | 145 | error_msg("Read error"); |
146 | 146 | ||
147 | if (trans_ptr == uu_std) { | 147 | if (trans_ptr == uu_std) { |
148 | putchar (ENC ('\0')); | 148 | putchar (ENC ('\0')); |
@@ -196,7 +196,7 @@ int uuencode_main (int argc, | |||
196 | encode(); | 196 | encode(); |
197 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); | 197 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); |
198 | if (ferror (stdout)) { | 198 | if (ferror (stdout)) { |
199 | error_msg("Write error\n"); | 199 | error_msg("Write error"); |
200 | return EXIT_FAILURE; | 200 | return EXIT_FAILURE; |
201 | } | 201 | } |
202 | return EXIT_SUCCESS; | 202 | return EXIT_SUCCESS; |
@@ -148,7 +148,7 @@ int wget_main(int argc, char **argv) | |||
148 | #endif | 148 | #endif |
149 | } | 149 | } |
150 | if (do_continue && !fname_out) | 150 | if (do_continue && !fname_out) |
151 | error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n"); | 151 | error_msg_and_die("cannot specify continue (-c) without a filename (-O)"); |
152 | 152 | ||
153 | 153 | ||
154 | /* | 154 | /* |
@@ -200,7 +200,7 @@ int wget_main(int argc, char **argv) | |||
200 | */ | 200 | */ |
201 | if (fgets(buf, sizeof(buf), sfp) == NULL) { | 201 | if (fgets(buf, sizeof(buf), sfp) == NULL) { |
202 | close_and_delete_outfile(output, fname_out, do_continue); | 202 | close_and_delete_outfile(output, fname_out, do_continue); |
203 | error_msg_and_die("no response from server\n"); | 203 | error_msg_and_die("no response from server"); |
204 | } | 204 | } |
205 | for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) | 205 | for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) |
206 | ; | 206 | ; |
@@ -230,7 +230,7 @@ int wget_main(int argc, char **argv) | |||
230 | } | 230 | } |
231 | if (strcasecmp(buf, "transfer-encoding") == 0) { | 231 | if (strcasecmp(buf, "transfer-encoding") == 0) { |
232 | close_and_delete_outfile(output, fname_out, do_continue); | 232 | close_and_delete_outfile(output, fname_out, do_continue); |
233 | error_msg_and_die("server wants to do %s transfer encoding\n", s); | 233 | error_msg_and_die("server wants to do %s transfer encoding", s); |
234 | continue; | 234 | continue; |
235 | } | 235 | } |
236 | } | 236 | } |
@@ -267,7 +267,7 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path) | |||
267 | *uri_port = 80; | 267 | *uri_port = 80; |
268 | 268 | ||
269 | if (strncmp(url, "http://", 7) != 0) | 269 | if (strncmp(url, "http://", 7) != 0) |
270 | error_msg_and_die("not an http url: %s\n", url); | 270 | error_msg_and_die("not an http url: %s", url); |
271 | 271 | ||
272 | *uri_host = url + 7; | 272 | *uri_host = url + 7; |
273 | 273 | ||
@@ -297,7 +297,7 @@ FILE *open_socket(char *host, int port) | |||
297 | memset(&sin, 0, sizeof(sin)); | 297 | memset(&sin, 0, sizeof(sin)); |
298 | sin.sin_family = AF_INET; | 298 | sin.sin_family = AF_INET; |
299 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 299 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
300 | error_msg_and_die("cannot resolve %s\n", host); | 300 | error_msg_and_die("cannot resolve %s", host); |
301 | memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); | 301 | memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); |
302 | sin.sin_port = htons(port); | 302 | sin.sin_port = htons(port); |
303 | 303 | ||
@@ -338,7 +338,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc) | |||
338 | 338 | ||
339 | /* verify we are at the end of the header name */ | 339 | /* verify we are at the end of the header name */ |
340 | if (*s != ':') | 340 | if (*s != ':') |
341 | error_msg_and_die("bad header line: %s\n", buf); | 341 | error_msg_and_die("bad header line: %s", buf); |
342 | 342 | ||
343 | /* locate the start of the header value */ | 343 | /* locate the start of the header value */ |
344 | for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s) | 344 | for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s) |
@@ -532,7 +532,7 @@ progressmeter(int flag) | |||
532 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 532 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
533 | * SUCH DAMAGE. | 533 | * SUCH DAMAGE. |
534 | * | 534 | * |
535 | * $Id: wget.c,v 1.24 2001/01/31 17:49:47 andersen Exp $ | 535 | * $Id: wget.c,v 1.25 2001/01/31 19:00:21 kraai Exp $ |
536 | */ | 536 | */ |
537 | 537 | ||
538 | 538 | ||
@@ -38,5 +38,5 @@ extern int whoami_main(int argc, char **argv) | |||
38 | puts(user); | 38 | puts(user); |
39 | return EXIT_SUCCESS; | 39 | return EXIT_SUCCESS; |
40 | } | 40 | } |
41 | error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid); | 41 | error_msg_and_die("cannot find username for UID %u", (unsigned) uid); |
42 | } | 42 | } |