diff options
| author | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
|---|---|---|
| committer | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
| commit | f57c944e09417edcbcd69f2b01b937cadef39db2 (patch) | |
| tree | a55822621d54bd82c54e272fa986e45698fea0f1 /coreutils | |
| parent | 7b5c16ebe5f1b057603cf1c0b0187be418725c42 (diff) | |
| download | busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.gz busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.bz2 busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.zip | |
Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/chroot.c | 4 | ||||
| -rw-r--r-- | coreutils/cut.c | 18 | ||||
| -rw-r--r-- | coreutils/date.c | 14 | ||||
| -rw-r--r-- | coreutils/dd.c | 24 | ||||
| -rw-r--r-- | coreutils/df.c | 8 | ||||
| -rw-r--r-- | coreutils/du.c | 6 | ||||
| -rw-r--r-- | coreutils/expr.c | 20 | ||||
| -rw-r--r-- | coreutils/head.c | 2 | ||||
| -rw-r--r-- | coreutils/id.c | 2 | ||||
| -rw-r--r-- | coreutils/ln.c | 4 | ||||
| -rw-r--r-- | coreutils/logname.c | 2 | ||||
| -rw-r--r-- | coreutils/ls.c | 8 | ||||
| -rw-r--r-- | coreutils/md5sum.c | 36 | ||||
| -rw-r--r-- | coreutils/mkdir.c | 8 | ||||
| -rw-r--r-- | coreutils/mknod.c | 2 | ||||
| -rw-r--r-- | coreutils/pwd.c | 2 | ||||
| -rw-r--r-- | coreutils/rm.c | 8 | ||||
| -rw-r--r-- | coreutils/rmdir.c | 2 | ||||
| -rw-r--r-- | coreutils/sort.c | 4 | ||||
| -rw-r--r-- | coreutils/tail.c | 4 | ||||
| -rw-r--r-- | coreutils/tee.c | 2 | ||||
| -rw-r--r-- | coreutils/test.c | 10 | ||||
| -rw-r--r-- | coreutils/touch.c | 4 | ||||
| -rw-r--r-- | coreutils/tr.c | 2 | ||||
| -rw-r--r-- | coreutils/uudecode.c | 24 | ||||
| -rw-r--r-- | coreutils/uuencode.c | 6 | ||||
| -rw-r--r-- | coreutils/whoami.c | 2 |
27 files changed, 114 insertions, 114 deletions
diff --git a/coreutils/chroot.c b/coreutils/chroot.c index f279af18d..34daf7f25 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c | |||
| @@ -38,7 +38,7 @@ int chroot_main(int argc, char **argv) | |||
| 38 | argv++; | 38 | argv++; |
| 39 | 39 | ||
| 40 | if (chroot(*argv) || (chdir("/"))) { | 40 | if (chroot(*argv) || (chdir("/"))) { |
| 41 | fatalError("cannot change root directory to %s: %s\n", *argv, strerror(errno)); | 41 | error_msg_and_die("cannot change root directory to %s: %s\n", *argv, strerror(errno)); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | argc--; | 44 | argc--; |
| @@ -57,7 +57,7 @@ int chroot_main(int argc, char **argv) | |||
| 57 | return EXIT_SUCCESS; | 57 | return EXIT_SUCCESS; |
| 58 | #endif | 58 | #endif |
| 59 | } | 59 | } |
| 60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); | 60 | error_msg_and_die("cannot execute %s: %s\n", prog, strerror(errno)); |
| 61 | 61 | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
diff --git a/coreutils/cut.c b/coreutils/cut.c index b281fa234..6e0fe83fc 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 | fatalError("invalid byte or field list\n"); | 57 | error_msg_and_die("invalid byte or field list\n"); |
| 58 | } | 58 | } |
| 59 | if (*ptr == '-') { | 59 | if (*ptr == '-') { |
| 60 | nminus++; | 60 | nminus++; |
| 61 | if (nminus > 1) { | 61 | if (nminus > 1) { |
| 62 | fatalError("invalid byte or field list\n"); | 62 | error_msg_and_die("invalid byte or field list\n"); |
| 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 | fatalError("missing list of fields\n"); | 71 | error_msg_and_die("missing list of fields\n"); |
| 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 | fatalError("only one type of list may be specified"); | 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 | fatalError("the delimiter must be a single character\n"); | 198 | error_msg_and_die("the delimiter must be a single character\n"); |
| 199 | } | 199 | } |
| 200 | delim = optarg[0]; | 200 | delim = optarg[0]; |
| 201 | break; | 201 | break; |
| @@ -209,16 +209,16 @@ extern int cut_main(int argc, char **argv) | |||
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | if (part == 0) { | 211 | if (part == 0) { |
| 212 | fatalError("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\n"); |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | if (supress_non_delimited_lines && part != 'f') { | 215 | if (supress_non_delimited_lines && part != 'f') { |
| 216 | fatalError("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\n"); |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | if (delim != '\t' && part != 'f') { | 220 | if (delim != '\t' && part != 'f') { |
| 221 | fatalError("a delimiter may be specified only when operating on fields\n"); | 221 | error_msg_and_die("a delimiter may be specified only when operating on fields\n"); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | /* argv[(optind)..(argc-1)] should be names of file to process. If no | 224 | /* argv[(optind)..(argc-1)] should be names of file to process. If no |
| @@ -233,7 +233,7 @@ extern int cut_main(int argc, char **argv) | |||
| 233 | for (i = optind; i < argc; i++) { | 233 | for (i = optind; i < argc; i++) { |
| 234 | file = fopen(argv[i], "r"); | 234 | file = fopen(argv[i], "r"); |
| 235 | if (file == NULL) { | 235 | if (file == NULL) { |
| 236 | errorMsg("%s: %s\n", argv[i], strerror(errno)); | 236 | error_msg("%s: %s\n", argv[i], strerror(errno)); |
| 237 | } else { | 237 | } else { |
| 238 | cut_file(file); | 238 | cut_file(file); |
| 239 | fclose(file); | 239 | fclose(file); |
diff --git a/coreutils/date.c b/coreutils/date.c index 2e69bde4a..73fc70511 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
| @@ -56,7 +56,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string) | |||
| 56 | &(tm_time->tm_min), &(tm_time->tm_year)); | 56 | &(tm_time->tm_min), &(tm_time->tm_year)); |
| 57 | 57 | ||
| 58 | if (nr < 4 || nr > 5) { | 58 | if (nr < 4 || nr > 5) { |
| 59 | fatalError(invalid_date, t_string); | 59 | error_msg_and_die(invalid_date, t_string); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | /* correct for century - minor Y2K problem here? */ | 62 | /* correct for century - minor Y2K problem here? */ |
| @@ -121,7 +121,7 @@ struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) | |||
| 121 | t.tm_mon -= 1; /* Adjust dates from 1-12 to 0-11 */ | 121 | t.tm_mon -= 1; /* Adjust dates from 1-12 to 0-11 */ |
| 122 | 122 | ||
| 123 | } else { | 123 | } else { |
| 124 | fatalError(invalid_date, t_string); | 124 | error_msg_and_die(invalid_date, t_string); |
| 125 | } | 125 | } |
| 126 | *tm_time = t; | 126 | *tm_time = t; |
| 127 | return (tm_time); | 127 | return (tm_time); |
| @@ -156,7 +156,7 @@ int date_main(int argc, char **argv) | |||
| 156 | case 'u': | 156 | case 'u': |
| 157 | utc = 1; | 157 | utc = 1; |
| 158 | if (putenv("TZ=UTC0") != 0) | 158 | if (putenv("TZ=UTC0") != 0) |
| 159 | fatalError(memory_exhausted); | 159 | error_msg_and_die(memory_exhausted); |
| 160 | break; | 160 | break; |
| 161 | case 'd': | 161 | case 'd': |
| 162 | use_arg = 1; | 162 | use_arg = 1; |
| @@ -176,7 +176,7 @@ int date_main(int argc, char **argv) | |||
| 176 | } | 176 | } |
| 177 | #if 0 | 177 | #if 0 |
| 178 | else { | 178 | else { |
| 179 | errorMsg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt); | 179 | error_msg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt); |
| 180 | usage(date_usage); | 180 | usage(date_usage); |
| 181 | } | 181 | } |
| 182 | #endif | 182 | #endif |
| @@ -205,16 +205,16 @@ int date_main(int argc, char **argv) | |||
| 205 | /* Correct any day of week and day of year etc fields */ | 205 | /* Correct any day of week and day of year etc fields */ |
| 206 | tm = mktime(&tm_time); | 206 | tm = mktime(&tm_time); |
| 207 | if (tm < 0) | 207 | if (tm < 0) |
| 208 | fatalError(invalid_date, date_str); | 208 | error_msg_and_die(invalid_date, date_str); |
| 209 | if ( utc ) { | 209 | if ( utc ) { |
| 210 | if (putenv("TZ=UTC0") != 0) | 210 | if (putenv("TZ=UTC0") != 0) |
| 211 | fatalError(memory_exhausted); | 211 | error_msg_and_die(memory_exhausted); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | /* if setting time, set it */ | 214 | /* if setting time, set it */ |
| 215 | if (set_time) { | 215 | if (set_time) { |
| 216 | if (stime(&tm) < 0) { | 216 | if (stime(&tm) < 0) { |
| 217 | perrorMsg("cannot set date"); | 217 | perror_msg("cannot set date"); |
| 218 | } | 218 | } |
| 219 | } | 219 | } |
| 220 | } | 220 | } |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 044f167c3..626b54898 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
| @@ -71,28 +71,28 @@ extern int dd_main(int argc, char **argv) | |||
| 71 | else if (outFile == NULL && (strncmp(*argv, "of", 2) == 0)) | 71 | else if (outFile == NULL && (strncmp(*argv, "of", 2) == 0)) |
| 72 | outFile = ((strchr(*argv, '=')) + 1); | 72 | outFile = ((strchr(*argv, '=')) + 1); |
| 73 | else if (strncmp("count", *argv, 5) == 0) { | 73 | else if (strncmp("count", *argv, 5) == 0) { |
| 74 | count = getNum((strchr(*argv, '=')) + 1); | 74 | count = atoi_w_units((strchr(*argv, '=')) + 1); |
| 75 | if (count < 0) { | 75 | if (count < 0) { |
| 76 | errorMsg("Bad count value %s\n", *argv); | 76 | error_msg("Bad count value %s\n", *argv); |
| 77 | goto usage; | 77 | goto usage; |
| 78 | } | 78 | } |
| 79 | } else if (strncmp(*argv, "bs", 2) == 0) { | 79 | } else if (strncmp(*argv, "bs", 2) == 0) { |
| 80 | blockSize = getNum((strchr(*argv, '=')) + 1); | 80 | blockSize = atoi_w_units((strchr(*argv, '=')) + 1); |
| 81 | if (blockSize <= 0) { | 81 | if (blockSize <= 0) { |
| 82 | errorMsg("Bad block size value %s\n", *argv); | 82 | error_msg("Bad block size value %s\n", *argv); |
| 83 | goto usage; | 83 | goto usage; |
| 84 | } | 84 | } |
| 85 | } else if (strncmp(*argv, "skip", 4) == 0) { | 85 | } else if (strncmp(*argv, "skip", 4) == 0) { |
| 86 | skipBlocks = getNum((strchr(*argv, '=')) + 1); | 86 | skipBlocks = atoi_w_units((strchr(*argv, '=')) + 1); |
| 87 | if (skipBlocks <= 0) { | 87 | if (skipBlocks <= 0) { |
| 88 | errorMsg("Bad skip value %s\n", *argv); | 88 | error_msg("Bad skip value %s\n", *argv); |
| 89 | goto usage; | 89 | goto usage; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | } else if (strncmp(*argv, "seek", 4) == 0) { | 92 | } else if (strncmp(*argv, "seek", 4) == 0) { |
| 93 | seekBlocks = getNum((strchr(*argv, '=')) + 1); | 93 | seekBlocks = atoi_w_units((strchr(*argv, '=')) + 1); |
| 94 | if (seekBlocks <= 0) { | 94 | if (seekBlocks <= 0) { |
| 95 | errorMsg("Bad seek value %s\n", *argv); | 95 | error_msg("Bad seek value %s\n", *argv); |
| 96 | goto usage; | 96 | goto usage; |
| 97 | } | 97 | } |
| 98 | } else if (strncmp(*argv, "conv", 4) == 0) { | 98 | } else if (strncmp(*argv, "conv", 4) == 0) { |
| @@ -119,7 +119,7 @@ extern int dd_main(int argc, char **argv) | |||
| 119 | * here anyways... */ | 119 | * here anyways... */ |
| 120 | 120 | ||
| 121 | /* free(buf); */ | 121 | /* free(buf); */ |
| 122 | fatalPerror("%s", inFile); | 122 | perror_msg_and_die("%s", inFile); |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | if (outFile == NULL) | 125 | if (outFile == NULL) |
| @@ -134,7 +134,7 @@ extern int dd_main(int argc, char **argv) | |||
| 134 | 134 | ||
| 135 | /* close(inFd); | 135 | /* close(inFd); |
| 136 | free(buf); */ | 136 | free(buf); */ |
| 137 | fatalPerror("%s", outFile); | 137 | perror_msg_and_die("%s", outFile); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | lseek(inFd, (off_t) (skipBlocks * blockSize), SEEK_SET); | 140 | lseek(inFd, (off_t) (skipBlocks * blockSize), SEEK_SET); |
| @@ -146,13 +146,13 @@ extern int dd_main(int argc, char **argv) | |||
| 146 | ibs=BUFSIZ; | 146 | ibs=BUFSIZ; |
| 147 | 147 | ||
| 148 | while (totalSize > outTotal) { | 148 | while (totalSize > outTotal) { |
| 149 | inCc = fullRead(inFd, buf, ibs); | 149 | inCc = full_read(inFd, buf, ibs); |
| 150 | inTotal += inCc; | 150 | inTotal += inCc; |
| 151 | if ( (sync==TRUE) && (inCc>0) ) | 151 | if ( (sync==TRUE) && (inCc>0) ) |
| 152 | while (inCc<ibs) | 152 | while (inCc<ibs) |
| 153 | buf[inCc++]='\0'; | 153 | buf[inCc++]='\0'; |
| 154 | 154 | ||
| 155 | if ((outCc = fullWrite(outFd, buf, inCc)) < 1){ | 155 | if ((outCc = full_write(outFd, buf, inCc)) < 1){ |
| 156 | if (outCc < 0 ){ | 156 | if (outCc < 0 ){ |
| 157 | perror("Error during write"); | 157 | perror("Error during write"); |
| 158 | } | 158 | } |
diff --git a/coreutils/df.c b/coreutils/df.c index 969a5b982..dc4849049 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
| @@ -36,7 +36,7 @@ static int df(char *device, const char *mountPoint) | |||
| 36 | long blocks_percent_used; | 36 | long blocks_percent_used; |
| 37 | 37 | ||
| 38 | if (statfs(mountPoint, &s) != 0) { | 38 | if (statfs(mountPoint, &s) != 0) { |
| 39 | perrorMsg("%s", mountPoint); | 39 | perror_msg("%s", mountPoint); |
| 40 | return FALSE; | 40 | return FALSE; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| @@ -75,8 +75,8 @@ extern int df_main(int argc, char **argv) | |||
| 75 | usage(df_usage); | 75 | usage(df_usage); |
| 76 | } | 76 | } |
| 77 | while (argc > 1) { | 77 | while (argc > 1) { |
| 78 | if ((mountEntry = findMountPoint(argv[1], mtab_file)) == 0) { | 78 | if ((mountEntry = find_mount_point(argv[1], mtab_file)) == 0) { |
| 79 | errorMsg("%s: can't find mount point.\n", argv[1]); | 79 | error_msg("%s: can't find mount point.\n", argv[1]); |
| 80 | status = EXIT_FAILURE; | 80 | status = EXIT_FAILURE; |
| 81 | } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir)) | 81 | } else if (!df(mountEntry->mnt_fsname, mountEntry->mnt_dir)) |
| 82 | status = EXIT_FAILURE; | 82 | status = EXIT_FAILURE; |
| @@ -89,7 +89,7 @@ extern int df_main(int argc, char **argv) | |||
| 89 | 89 | ||
| 90 | mountTable = setmntent(mtab_file, "r"); | 90 | mountTable = setmntent(mtab_file, "r"); |
| 91 | if (mountTable == 0) { | 91 | if (mountTable == 0) { |
| 92 | perrorMsg("%s", mtab_file); | 92 | perror_msg("%s", mtab_file); |
| 93 | return EXIT_FAILURE; | 93 | return EXIT_FAILURE; |
| 94 | } | 94 | } |
| 95 | 95 | ||
diff --git a/coreutils/du.c b/coreutils/du.c index 313a910ad..fa76465e7 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
| @@ -97,7 +97,7 @@ static long du(char *filename) | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | if (len + strlen(name) + 1 > BUFSIZ) { | 99 | if (len + strlen(name) + 1 > BUFSIZ) { |
| 100 | errorMsg(name_too_long); | 100 | error_msg(name_too_long); |
| 101 | du_depth--; | 101 | du_depth--; |
| 102 | return 0; | 102 | return 0; |
| 103 | } | 103 | } |
| @@ -156,7 +156,7 @@ int du_main(int argc, char **argv) | |||
| 156 | for (i=optind; i < argc; i++) { | 156 | for (i=optind; i < argc; i++) { |
| 157 | if ((sum = du(argv[i])) == 0) | 157 | if ((sum = du(argv[i])) == 0) |
| 158 | status = EXIT_FAILURE; | 158 | status = EXIT_FAILURE; |
| 159 | if (sum && isDirectory(argv[i], FALSE, NULL)) { | 159 | if (sum && is_directory(argv[i], FALSE, NULL)) { |
| 160 | print_normal(sum, argv[i]); | 160 | print_normal(sum, argv[i]); |
| 161 | } | 161 | } |
| 162 | reset_ino_dev_hashtable(); | 162 | reset_ino_dev_hashtable(); |
| @@ -166,7 +166,7 @@ int du_main(int argc, char **argv) | |||
| 166 | return status; | 166 | return status; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | /* $Id: du.c,v 1.28 2000/12/06 15:56:31 kraai Exp $ */ | 169 | /* $Id: du.c,v 1.29 2000/12/07 19:56:48 markw Exp $ */ |
| 170 | /* | 170 | /* |
| 171 | Local Variables: | 171 | Local Variables: |
| 172 | c-file-style: "linux" | 172 | c-file-style: "linux" |
diff --git a/coreutils/expr.c b/coreutils/expr.c index 670352eb6..eed2637f2 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c | |||
| @@ -74,14 +74,14 @@ int expr_main (int argc, char **argv) | |||
| 74 | VALUE *v; | 74 | VALUE *v; |
| 75 | 75 | ||
| 76 | if (argc == 1) { | 76 | if (argc == 1) { |
| 77 | fatalError("too few arguments\n"); | 77 | error_msg_and_die("too few arguments\n"); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | args = argv + 1; | 80 | args = argv + 1; |
| 81 | 81 | ||
| 82 | v = eval (); | 82 | v = eval (); |
| 83 | if (*args) | 83 | if (*args) |
| 84 | fatalError ("syntax error\n"); | 84 | error_msg_and_die ("syntax error\n"); |
| 85 | 85 | ||
| 86 | if (v->type == integer) | 86 | if (v->type == integer) |
| 87 | printf ("%d\n", v->u.i); | 87 | printf ("%d\n", v->u.i); |
| @@ -216,7 +216,7 @@ static \ | |||
| 216 | int name (l, r) VALUE *l; VALUE *r; \ | 216 | int name (l, r) VALUE *l; VALUE *r; \ |
| 217 | { \ | 217 | { \ |
| 218 | if (!toarith (l) || !toarith (r)) \ | 218 | if (!toarith (l) || !toarith (r)) \ |
| 219 | fatalError ("non-numeric argument\n"); \ | 219 | error_msg_and_die ("non-numeric argument\n"); \ |
| 220 | return l->u.i op r->u.i; \ | 220 | return l->u.i op r->u.i; \ |
| 221 | } | 221 | } |
| 222 | 222 | ||
| @@ -224,9 +224,9 @@ int name (l, r) VALUE *l; VALUE *r; \ | |||
| 224 | int name (l, r) VALUE *l; VALUE *r; \ | 224 | int name (l, r) VALUE *l; VALUE *r; \ |
| 225 | { \ | 225 | { \ |
| 226 | if (!toarith (l) || !toarith (r)) \ | 226 | if (!toarith (l) || !toarith (r)) \ |
| 227 | fatalError ( "non-numeric argument\n"); \ | 227 | error_msg_and_die ( "non-numeric argument\n"); \ |
| 228 | if (r->u.i == 0) \ | 228 | if (r->u.i == 0) \ |
| 229 | fatalError ( "division by zero\n"); \ | 229 | error_msg_and_die ( "division by zero\n"); \ |
| 230 | return l->u.i op r->u.i; \ | 230 | return l->u.i op r->u.i; \ |
| 231 | } | 231 | } |
| 232 | 232 | ||
| @@ -270,7 +270,7 @@ of a basic regular expression is not portable; it is being ignored", | |||
| 270 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; | 270 | re_syntax_options = RE_SYNTAX_POSIX_BASIC; |
| 271 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); | 271 | errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); |
| 272 | if (errmsg) { | 272 | if (errmsg) { |
| 273 | fatalError("%s\n", errmsg); | 273 | error_msg_and_die("%s\n", errmsg); |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); | 276 | len = re_match (&re_buffer, sv->u.s, strlen (sv->u.s), 0, &re_regs); |
| @@ -301,19 +301,19 @@ static VALUE *eval7 (void) | |||
| 301 | VALUE *v; | 301 | VALUE *v; |
| 302 | 302 | ||
| 303 | if (!*args) | 303 | if (!*args) |
| 304 | fatalError ( "syntax error\n"); | 304 | error_msg_and_die ( "syntax error\n"); |
| 305 | 305 | ||
| 306 | if (nextarg ("(")) { | 306 | if (nextarg ("(")) { |
| 307 | args++; | 307 | args++; |
| 308 | v = eval (); | 308 | v = eval (); |
| 309 | if (!nextarg (")")) | 309 | if (!nextarg (")")) |
| 310 | fatalError ( "syntax error\n"); | 310 | error_msg_and_die ( "syntax error\n"); |
| 311 | args++; | 311 | args++; |
| 312 | return v; | 312 | return v; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | if (nextarg (")")) | 315 | if (nextarg (")")) |
| 316 | fatalError ( "syntax error\n"); | 316 | error_msg_and_die ( "syntax error\n"); |
| 317 | 317 | ||
| 318 | return str_value (*args++); | 318 | return str_value (*args++); |
| 319 | } | 319 | } |
| @@ -327,7 +327,7 @@ static VALUE *eval6 (void) | |||
| 327 | if (nextarg ("quote")) { | 327 | if (nextarg ("quote")) { |
| 328 | args++; | 328 | args++; |
| 329 | if (!*args) | 329 | if (!*args) |
| 330 | fatalError ( "syntax error\n"); | 330 | error_msg_and_die ( "syntax error\n"); |
| 331 | return str_value (*args++); | 331 | return str_value (*args++); |
| 332 | } | 332 | } |
| 333 | else if (nextarg ("length")) { | 333 | else if (nextarg ("length")) { |
diff --git a/coreutils/head.c b/coreutils/head.c index 92b43bae2..f3aef1b9b 100644 --- a/coreutils/head.c +++ b/coreutils/head.c | |||
| @@ -80,7 +80,7 @@ int head_main(int argc, char **argv) | |||
| 80 | } | 80 | } |
| 81 | head(len, fp); | 81 | head(len, fp); |
| 82 | if (errno) { | 82 | if (errno) { |
| 83 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 83 | error_msg("%s: %s\n", argv[optind], strerror(errno)); |
| 84 | status = EXIT_FAILURE; | 84 | status = EXIT_FAILURE; |
| 85 | errno = 0; | 85 | errno = 0; |
| 86 | } | 86 | } |
diff --git a/coreutils/id.c b/coreutils/id.c index fdfc33cdc..86667f516 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
| @@ -78,7 +78,7 @@ extern int id_main(int argc, char **argv) | |||
| 78 | pwnam=my_getpwnam(user); | 78 | pwnam=my_getpwnam(user); |
| 79 | grnam=my_getgrnam(group); | 79 | grnam=my_getgrnam(group); |
| 80 | if (gid == -1 || pwnam==-1 || grnam==-1) { | 80 | if (gid == -1 || pwnam==-1 || grnam==-1) { |
| 81 | fatalError("%s: No such user\n", user); | 81 | error_msg_and_die("%s: No such user\n", user); |
| 82 | } | 82 | } |
| 83 | if (no_group) | 83 | if (no_group) |
| 84 | printf("%ld\n", pwnam); | 84 | printf("%ld\n", pwnam); |
diff --git a/coreutils/ln.c b/coreutils/ln.c index e81dbafae..ead5322fa 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c | |||
| @@ -55,9 +55,9 @@ static int fs_link(const char *link_DestName, const char *link_SrcName, const in | |||
| 55 | strcpy(srcName, link_SrcName); | 55 | strcpy(srcName, link_SrcName); |
| 56 | 56 | ||
| 57 | if (flag&LN_NODEREFERENCE) | 57 | if (flag&LN_NODEREFERENCE) |
| 58 | srcIsDir = isDirectory(srcName, TRUE, NULL); | 58 | srcIsDir = is_directory(srcName, TRUE, NULL); |
| 59 | else | 59 | else |
| 60 | srcIsDir = isDirectory(srcName, FALSE, NULL); | 60 | srcIsDir = is_directory(srcName, FALSE, NULL); |
| 61 | 61 | ||
| 62 | if ((srcIsDir==TRUE)&&((flag&LN_NODEREFERENCE)==0)) { | 62 | if ((srcIsDir==TRUE)&&((flag&LN_NODEREFERENCE)==0)) { |
| 63 | strcat(srcName, "/"); | 63 | strcat(srcName, "/"); |
diff --git a/coreutils/logname.c b/coreutils/logname.c index 89c409f00..1fc518bfc 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c | |||
| @@ -35,5 +35,5 @@ extern int logname_main(int argc, char **argv) | |||
| 35 | puts(user); | 35 | puts(user); |
| 36 | return EXIT_SUCCESS; | 36 | return EXIT_SUCCESS; |
| 37 | } | 37 | } |
| 38 | fatalError("no login name\n"); | 38 | error_msg_and_die("no login name\n"); |
| 39 | } | 39 | } |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 225132ba4..94c73b377 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
| @@ -181,7 +181,7 @@ static int my_stat(struct dnode *cur) | |||
| 181 | #ifdef BB_FEATURE_LS_FOLLOWLINKS | 181 | #ifdef BB_FEATURE_LS_FOLLOWLINKS |
| 182 | if (follow_links == TRUE) { | 182 | if (follow_links == TRUE) { |
| 183 | if (stat(cur->fullname, &cur->dstat)) { | 183 | if (stat(cur->fullname, &cur->dstat)) { |
| 184 | errorMsg("%s: %s\n", cur->fullname, strerror(errno)); | 184 | error_msg("%s: %s\n", cur->fullname, strerror(errno)); |
| 185 | status = EXIT_FAILURE; | 185 | status = EXIT_FAILURE; |
| 186 | free(cur->fullname); | 186 | free(cur->fullname); |
| 187 | free(cur); | 187 | free(cur); |
| @@ -190,7 +190,7 @@ static int my_stat(struct dnode *cur) | |||
| 190 | } else | 190 | } else |
| 191 | #endif | 191 | #endif |
| 192 | if (lstat(cur->fullname, &cur->dstat)) { | 192 | if (lstat(cur->fullname, &cur->dstat)) { |
| 193 | errorMsg("%s: %s\n", cur->fullname, strerror(errno)); | 193 | error_msg("%s: %s\n", cur->fullname, strerror(errno)); |
| 194 | status = EXIT_FAILURE; | 194 | status = EXIT_FAILURE; |
| 195 | free(cur->fullname); | 195 | free(cur->fullname); |
| 196 | free(cur); | 196 | free(cur); |
| @@ -511,7 +511,7 @@ struct dnode **list_dir(char *path) | |||
| 511 | nfiles= 0; | 511 | nfiles= 0; |
| 512 | dir = opendir(path); | 512 | dir = opendir(path); |
| 513 | if (dir == NULL) { | 513 | if (dir == NULL) { |
| 514 | errorMsg("%s: %s\n", path, strerror(errno)); | 514 | error_msg("%s: %s\n", path, strerror(errno)); |
| 515 | status = EXIT_FAILURE; | 515 | status = EXIT_FAILURE; |
| 516 | return(NULL); /* could not open the dir */ | 516 | return(NULL); /* could not open the dir */ |
| 517 | } | 517 | } |
| @@ -591,7 +591,7 @@ int list_single(struct dnode *dn) | |||
| 591 | column += 5; | 591 | column += 5; |
| 592 | break; | 592 | break; |
| 593 | case LIST_MODEBITS: | 593 | case LIST_MODEBITS: |
| 594 | fprintf(stdout, "%10s", (char *)modeString(dn->dstat.st_mode)); | 594 | fprintf(stdout, "%10s", (char *)mode_string(dn->dstat.st_mode)); |
| 595 | column += 10; | 595 | column += 10; |
| 596 | break; | 596 | break; |
| 597 | case LIST_NLINKS: | 597 | case LIST_NLINKS: |
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c index 84e037a61..57fac7450 100644 --- a/coreutils/md5sum.c +++ b/coreutils/md5sum.c | |||
| @@ -651,13 +651,13 @@ static int md5_file(const char *filename, | |||
| 651 | } else { | 651 | } else { |
| 652 | fp = fopen(filename, OPENOPTS(binary)); | 652 | fp = fopen(filename, OPENOPTS(binary)); |
| 653 | if (fp == NULL) { | 653 | if (fp == NULL) { |
| 654 | errorMsg("%s: %s\n", filename, strerror(errno)); | 654 | error_msg("%s: %s\n", filename, strerror(errno)); |
| 655 | return FALSE; | 655 | return FALSE; |
| 656 | } | 656 | } |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | if (md5_stream(fp, md5_result)) { | 659 | if (md5_stream(fp, md5_result)) { |
| 660 | errorMsg("%s: %s\n", filename, strerror(errno)); | 660 | error_msg("%s: %s\n", filename, strerror(errno)); |
| 661 | 661 | ||
| 662 | if (fp != stdin) | 662 | if (fp != stdin) |
| 663 | fclose(fp); | 663 | fclose(fp); |
| @@ -665,7 +665,7 @@ static int md5_file(const char *filename, | |||
| 665 | } | 665 | } |
| 666 | 666 | ||
| 667 | if (fp != stdin && fclose(fp) == EOF) { | 667 | if (fp != stdin && fclose(fp) == EOF) { |
| 668 | errorMsg("%s: %s\n", filename, strerror(errno)); | 668 | error_msg("%s: %s\n", filename, strerror(errno)); |
| 669 | return FALSE; | 669 | return FALSE; |
| 670 | } | 670 | } |
| 671 | 671 | ||
| @@ -689,7 +689,7 @@ static int md5_check(const char *checkfile_name) | |||
| 689 | } else { | 689 | } else { |
| 690 | checkfile_stream = fopen(checkfile_name, "r"); | 690 | checkfile_stream = fopen(checkfile_name, "r"); |
| 691 | if (checkfile_stream == NULL) { | 691 | if (checkfile_stream == NULL) { |
| 692 | errorMsg("%s: %s\n", checkfile_name, strerror(errno)); | 692 | error_msg("%s: %s\n", checkfile_name, strerror(errno)); |
| 693 | return FALSE; | 693 | return FALSE; |
| 694 | } | 694 | } |
| 695 | } | 695 | } |
| @@ -722,7 +722,7 @@ static int md5_check(const char *checkfile_name) | |||
| 722 | if (split_3(line, line_length, &md5num, &binary, &filename) | 722 | if (split_3(line, line_length, &md5num, &binary, &filename) |
| 723 | || !hex_digits(md5num)) { | 723 | || !hex_digits(md5num)) { |
| 724 | if (warn) { | 724 | if (warn) { |
| 725 | errorMsg("%s: %lu: improperly formatted MD5 checksum line\n", | 725 | error_msg("%s: %lu: improperly formatted MD5 checksum line\n", |
| 726 | checkfile_name, (unsigned long) line_number); | 726 | checkfile_name, (unsigned long) line_number); |
| 727 | } | 727 | } |
| 728 | } else { | 728 | } else { |
| @@ -770,18 +770,18 @@ static int md5_check(const char *checkfile_name) | |||
| 770 | free(line); | 770 | free(line); |
| 771 | 771 | ||
| 772 | if (ferror(checkfile_stream)) { | 772 | if (ferror(checkfile_stream)) { |
| 773 | errorMsg("%s: read error\n", checkfile_name); /* */ | 773 | error_msg("%s: read error\n", checkfile_name); /* */ |
| 774 | return FALSE; | 774 | return FALSE; |
| 775 | } | 775 | } |
| 776 | 776 | ||
| 777 | if (checkfile_stream != stdin && fclose(checkfile_stream) == EOF) { | 777 | if (checkfile_stream != stdin && fclose(checkfile_stream) == EOF) { |
| 778 | errorMsg("md5sum: %s: %s\n", checkfile_name, strerror(errno)); | 778 | error_msg("md5sum: %s: %s\n", checkfile_name, strerror(errno)); |
| 779 | return FALSE; | 779 | return FALSE; |
| 780 | } | 780 | } |
| 781 | 781 | ||
| 782 | if (n_properly_formated_lines == 0) { | 782 | if (n_properly_formated_lines == 0) { |
| 783 | /* Warn if no tests are found. */ | 783 | /* Warn if no tests are found. */ |
| 784 | errorMsg("%s: no properly formatted MD5 checksum lines found\n", | 784 | error_msg("%s: no properly formatted MD5 checksum lines found\n", |
| 785 | checkfile_name); | 785 | checkfile_name); |
| 786 | return FALSE; | 786 | return FALSE; |
| 787 | } else { | 787 | } else { |
| @@ -790,13 +790,13 @@ static int md5_check(const char *checkfile_name) | |||
| 790 | - n_open_or_read_failures); | 790 | - n_open_or_read_failures); |
| 791 | 791 | ||
| 792 | if (n_open_or_read_failures > 0) { | 792 | if (n_open_or_read_failures > 0) { |
| 793 | errorMsg("WARNING: %d of %d listed files could not be read\n", | 793 | error_msg("WARNING: %d of %d listed files could not be read\n", |
| 794 | n_open_or_read_failures, n_properly_formated_lines); | 794 | n_open_or_read_failures, n_properly_formated_lines); |
| 795 | return FALSE; | 795 | return FALSE; |
| 796 | } | 796 | } |
| 797 | 797 | ||
| 798 | if (n_mismatched_checksums > 0) { | 798 | if (n_mismatched_checksums > 0) { |
| 799 | errorMsg("WARNING: %d of %d computed checksums did NOT match\n", | 799 | error_msg("WARNING: %d of %d computed checksums did NOT match\n", |
| 800 | n_mismatched_checksums, n_computed_checkums); | 800 | n_mismatched_checksums, n_computed_checkums); |
| 801 | return FALSE; | 801 | return FALSE; |
| 802 | } | 802 | } |
| @@ -861,22 +861,22 @@ int md5sum_main(int argc, | |||
| 861 | } | 861 | } |
| 862 | 862 | ||
| 863 | if (file_type_specified && do_check) { | 863 | if (file_type_specified && do_check) { |
| 864 | errorMsg("the -b and -t options are meaningless when verifying checksums\n"); | 864 | error_msg("the -b and -t options are meaningless when verifying checksums\n"); |
| 865 | return EXIT_FAILURE; | 865 | return EXIT_FAILURE; |
| 866 | } | 866 | } |
| 867 | 867 | ||
| 868 | if (n_strings > 0 && do_check) { | 868 | if (n_strings > 0 && do_check) { |
| 869 | errorMsg("the -g and -c options are mutually exclusive\n"); | 869 | error_msg("the -g and -c options are mutually exclusive\n"); |
| 870 | return EXIT_FAILURE; | 870 | return EXIT_FAILURE; |
| 871 | } | 871 | } |
| 872 | 872 | ||
| 873 | if (status_only && !do_check) { | 873 | if (status_only && !do_check) { |
| 874 | errorMsg("the -s option is meaningful only when verifying checksums\n"); | 874 | error_msg("the -s option is meaningful only when verifying checksums\n"); |
| 875 | return EXIT_FAILURE; | 875 | return EXIT_FAILURE; |
| 876 | } | 876 | } |
| 877 | 877 | ||
| 878 | if (warn && !do_check) { | 878 | if (warn && !do_check) { |
| 879 | errorMsg("the -w option is meaningful only when verifying checksums\n"); | 879 | error_msg("the -w option is meaningful only when verifying checksums\n"); |
| 880 | return EXIT_FAILURE; | 880 | return EXIT_FAILURE; |
| 881 | } | 881 | } |
| 882 | 882 | ||
| @@ -884,7 +884,7 @@ int md5sum_main(int argc, | |||
| 884 | size_t i; | 884 | size_t i; |
| 885 | 885 | ||
| 886 | if (optind < argc) { | 886 | if (optind < argc) { |
| 887 | errorMsg("no files may be specified when using -g\n"); | 887 | error_msg("no files may be specified when using -g\n"); |
| 888 | return EXIT_FAILURE; | 888 | return EXIT_FAILURE; |
| 889 | } | 889 | } |
| 890 | for (i = 0; i < n_strings; ++i) { | 890 | for (i = 0; i < n_strings; ++i) { |
| @@ -898,7 +898,7 @@ int md5sum_main(int argc, | |||
| 898 | } | 898 | } |
| 899 | } else if (do_check) { | 899 | } else if (do_check) { |
| 900 | if (optind + 1 < argc) { | 900 | if (optind + 1 < argc) { |
| 901 | errorMsg("only one argument may be specified when using -c\n"); | 901 | error_msg("only one argument may be specified when using -c\n"); |
| 902 | } | 902 | } |
| 903 | 903 | ||
| 904 | err = md5_check ((optind == argc) ? "-" : argv[optind]); | 904 | err = md5_check ((optind == argc) ? "-" : argv[optind]); |
| @@ -951,12 +951,12 @@ int md5sum_main(int argc, | |||
| 951 | } | 951 | } |
| 952 | 952 | ||
| 953 | if (fclose (stdout) == EOF) { | 953 | if (fclose (stdout) == EOF) { |
| 954 | errorMsg("write error\n"); | 954 | error_msg("write error\n"); |
| 955 | return EXIT_FAILURE; | 955 | return EXIT_FAILURE; |
| 956 | } | 956 | } |
| 957 | 957 | ||
| 958 | if (have_read_stdin && fclose (stdin) == EOF) { | 958 | if (have_read_stdin && fclose (stdin) == EOF) { |
| 959 | errorMsg("standard input\n"); | 959 | error_msg("standard input\n"); |
| 960 | return EXIT_FAILURE; | 960 | return EXIT_FAILURE; |
| 961 | } | 961 | } |
| 962 | 962 | ||
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index c950847dc..92357a665 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
| @@ -50,7 +50,7 @@ extern int mkdir_main(int argc, char **argv) | |||
| 50 | /* Find the specified modes */ | 50 | /* Find the specified modes */ |
| 51 | mode = 0; | 51 | mode = 0; |
| 52 | if (parse_mode(*(++argv), &mode) == FALSE) { | 52 | if (parse_mode(*(++argv), &mode) == FALSE) { |
| 53 | errorMsg("Unknown mode: %s\n", *argv); | 53 | error_msg("Unknown mode: %s\n", *argv); |
| 54 | return EXIT_FAILURE; | 54 | return EXIT_FAILURE; |
| 55 | } | 55 | } |
| 56 | /* Set the umask for this process so it doesn't | 56 | /* Set the umask for this process so it doesn't |
| @@ -79,18 +79,18 @@ extern int mkdir_main(int argc, char **argv) | |||
| 79 | char buf[BUFSIZ + 1]; | 79 | char buf[BUFSIZ + 1]; |
| 80 | 80 | ||
| 81 | if (strlen(*argv) > BUFSIZ - 1) { | 81 | if (strlen(*argv) > BUFSIZ - 1) { |
| 82 | errorMsg(name_too_long); | 82 | error_msg(name_too_long); |
| 83 | return EXIT_FAILURE; | 83 | return EXIT_FAILURE; |
| 84 | } | 84 | } |
| 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 | errorMsg("%s: File exists\n", buf); | 88 | error_msg("%s: File exists\n", buf); |
| 89 | return EXIT_FAILURE; | 89 | return EXIT_FAILURE; |
| 90 | } | 90 | } |
| 91 | if (parentFlag == TRUE) { | 91 | if (parentFlag == TRUE) { |
| 92 | strcat(buf, "/"); | 92 | strcat(buf, "/"); |
| 93 | createPath(buf, mode); | 93 | create_path(buf, mode); |
| 94 | } else { | 94 | } else { |
| 95 | if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { | 95 | if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { |
| 96 | perror(buf); | 96 | perror(buf); |
diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 21b2689cc..022ab8571 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c | |||
| @@ -84,7 +84,7 @@ int mknod_main(int argc, char **argv) | |||
| 84 | mode |= perm; | 84 | mode |= perm; |
| 85 | 85 | ||
| 86 | if (mknod(argv[0], mode, dev) != 0) | 86 | if (mknod(argv[0], mode, dev) != 0) |
| 87 | fatalError("%s: %s\n", argv[0], strerror(errno)); | 87 | error_msg_and_die("%s: %s\n", argv[0], strerror(errno)); |
| 88 | return EXIT_SUCCESS; | 88 | return EXIT_SUCCESS; |
| 89 | } | 89 | } |
| 90 | 90 | ||
diff --git a/coreutils/pwd.c b/coreutils/pwd.c index 54129b175..71731944c 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c | |||
| @@ -31,7 +31,7 @@ extern int pwd_main(int argc, char **argv) | |||
| 31 | char buf[BUFSIZ + 1]; | 31 | char buf[BUFSIZ + 1]; |
| 32 | 32 | ||
| 33 | if (getcwd(buf, sizeof(buf)) == NULL) | 33 | if (getcwd(buf, sizeof(buf)) == NULL) |
| 34 | fatalError("%s\n", strerror(errno)); | 34 | error_msg_and_die("%s\n", strerror(errno)); |
| 35 | 35 | ||
| 36 | printf("%s\n", buf); | 36 | printf("%s\n", buf); |
| 37 | return EXIT_SUCCESS; | 37 | return EXIT_SUCCESS; |
diff --git a/coreutils/rm.c b/coreutils/rm.c index 566335158..a9501ec7f 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
| @@ -37,7 +37,7 @@ static const char *srcName; | |||
| 37 | static int fileAction(const char *fileName, struct stat *statbuf, void* junk) | 37 | static int fileAction(const char *fileName, struct stat *statbuf, void* junk) |
| 38 | { | 38 | { |
| 39 | if (unlink(fileName) < 0) { | 39 | if (unlink(fileName) < 0) { |
| 40 | perrorMsg("%s", fileName); | 40 | perror_msg("%s", fileName); |
| 41 | return (FALSE); | 41 | return (FALSE); |
| 42 | } | 42 | } |
| 43 | return (TRUE); | 43 | return (TRUE); |
| @@ -47,11 +47,11 @@ static int dirAction(const char *fileName, struct stat *statbuf, void* junk) | |||
| 47 | { | 47 | { |
| 48 | if (recursiveFlag == FALSE) { | 48 | if (recursiveFlag == FALSE) { |
| 49 | errno = EISDIR; | 49 | errno = EISDIR; |
| 50 | perrorMsg("%s", fileName); | 50 | perror_msg("%s", fileName); |
| 51 | return (FALSE); | 51 | return (FALSE); |
| 52 | } | 52 | } |
| 53 | if (rmdir(fileName) < 0) { | 53 | if (rmdir(fileName) < 0) { |
| 54 | perrorMsg("%s", fileName); | 54 | perror_msg("%s", fileName); |
| 55 | return (FALSE); | 55 | return (FALSE); |
| 56 | } | 56 | } |
| 57 | return (TRUE); | 57 | return (TRUE); |
| @@ -101,7 +101,7 @@ extern int rm_main(int argc, char **argv) | |||
| 101 | && errno == ENOENT) { | 101 | && errno == ENOENT) { |
| 102 | /* do not reports errors for non-existent files if -f, just skip them */ | 102 | /* do not reports errors for non-existent files if -f, just skip them */ |
| 103 | } else { | 103 | } else { |
| 104 | if (recursiveAction(srcName, recursiveFlag, FALSE, | 104 | if (recursive_action(srcName, recursiveFlag, FALSE, |
| 105 | TRUE, fileAction, dirAction, NULL) == FALSE) { | 105 | TRUE, fileAction, dirAction, NULL) == FALSE) { |
| 106 | status = EXIT_FAILURE; | 106 | status = EXIT_FAILURE; |
| 107 | } | 107 | } |
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index dfe53b215..f9f82bba4 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c | |||
| @@ -35,7 +35,7 @@ extern int rmdir_main(int argc, char **argv) | |||
| 35 | 35 | ||
| 36 | while (--argc > 0) { | 36 | while (--argc > 0) { |
| 37 | if (rmdir(*(++argv)) == -1) { | 37 | if (rmdir(*(++argv)) == -1) { |
| 38 | perrorMsg("%s", *argv); | 38 | perror_msg("%s", *argv); |
| 39 | status = EXIT_FAILURE; | 39 | status = EXIT_FAILURE; |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
diff --git a/coreutils/sort.c b/coreutils/sort.c index d6c3e9a5b..b0bf6e494 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
| @@ -247,7 +247,7 @@ int sort_main(int argc, char **argv) | |||
| 247 | break; | 247 | break; |
| 248 | #endif | 248 | #endif |
| 249 | default: | 249 | default: |
| 250 | errorMsg("invalid option -- %c\n", opt); | 250 | error_msg("invalid option -- %c\n", opt); |
| 251 | usage(sort_usage); | 251 | usage(sort_usage); |
| 252 | } | 252 | } |
| 253 | } else { | 253 | } else { |
| @@ -286,4 +286,4 @@ int sort_main(int argc, char **argv) | |||
| 286 | return(0); | 286 | return(0); |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | /* $Id: sort.c,v 1.23 2000/09/28 17:49:59 beppu Exp $ */ | 289 | /* $Id: sort.c,v 1.24 2000/12/07 19:56:48 markw Exp $ */ |
diff --git a/coreutils/tail.c b/coreutils/tail.c index a9da95462..308bb3085 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
| @@ -225,7 +225,7 @@ int tail_main(int argc, char **argv) | |||
| 225 | usage(tail_usage); | 225 | usage(tail_usage); |
| 226 | break; | 226 | break; |
| 227 | default: | 227 | default: |
| 228 | errorMsg("\nUnknown arg: %c.\n\n",optopt); | 228 | error_msg("\nUnknown arg: %c.\n\n",optopt); |
| 229 | usage(tail_usage); | 229 | usage(tail_usage); |
| 230 | } | 230 | } |
| 231 | } | 231 | } |
| @@ -263,7 +263,7 @@ int tail_main(int argc, char **argv) | |||
| 263 | else | 263 | else |
| 264 | fd[test] = open(files[test], O_RDONLY); | 264 | fd[test] = open(files[test], O_RDONLY); |
| 265 | if (fd[test] == -1) | 265 | if (fd[test] == -1) |
| 266 | fatalError("Unable to open file %s.\n", files[test]); | 266 | error_msg_and_die("Unable to open file %s.\n", files[test]); |
| 267 | tail_stream(fd[test]); | 267 | tail_stream(fd[test]); |
| 268 | 268 | ||
| 269 | bs=BUFSIZ; | 269 | bs=BUFSIZ; |
diff --git a/coreutils/tee.c b/coreutils/tee.c index 621801336..347684a28 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c | |||
| @@ -47,7 +47,7 @@ tee_main(int argc, char **argv) | |||
| 47 | while (optind < argc) { | 47 | while (optind < argc) { |
| 48 | if ((files[nfiles++] = fopen(argv[optind++], mode)) == NULL) { | 48 | if ((files[nfiles++] = fopen(argv[optind++], mode)) == NULL) { |
| 49 | nfiles--; | 49 | nfiles--; |
| 50 | errorMsg("%s: %s\n", argv[optind-1], strerror(errno)); | 50 | error_msg("%s: %s\n", argv[optind-1], strerror(errno)); |
| 51 | status = 1; | 51 | status = 1; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
diff --git a/coreutils/test.c b/coreutils/test.c index acd6947d9..d1a0b6025 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 | fatalError("missing ]\n"); | 187 | error_msg_and_die("missing ]\n"); |
| 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 | fatalError("%s: %s\n", op, msg); | 236 | error_msg_and_die("%s: %s\n", op, msg); |
| 237 | else | 237 | else |
| 238 | fatalError("%s\n", msg); | 238 | error_msg_and_die("%s\n", 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 | fatalError("%s: out of range\n", s); | 473 | error_msg_and_die("%s: out of range\n", s); |
| 474 | 474 | ||
| 475 | while (isspace(*p)) | 475 | while (isspace(*p)) |
| 476 | p++; | 476 | p++; |
| 477 | 477 | ||
| 478 | if (*p) | 478 | if (*p) |
| 479 | fatalError("%s: bad number\n", s); | 479 | error_msg_and_die("%s: bad number\n", s); |
| 480 | 480 | ||
| 481 | return (int) r; | 481 | return (int) r; |
| 482 | } | 482 | } |
diff --git a/coreutils/touch.c b/coreutils/touch.c index 5537fb63b..59800b2a0 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c | |||
| @@ -58,12 +58,12 @@ extern int touch_main(int argc, char **argv) | |||
| 58 | if (create == FALSE && errno == ENOENT) | 58 | if (create == FALSE && errno == ENOENT) |
| 59 | return EXIT_SUCCESS; | 59 | return EXIT_SUCCESS; |
| 60 | else { | 60 | else { |
| 61 | fatalError("%s", strerror(errno)); | 61 | error_msg_and_die("%s", strerror(errno)); |
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | close(fd); | 64 | close(fd); |
| 65 | if (utime(*argv, NULL)) { | 65 | if (utime(*argv, NULL)) { |
| 66 | fatalError("%s", strerror(errno)); | 66 | error_msg_and_die("%s", strerror(errno)); |
| 67 | } | 67 | } |
| 68 | argc--; | 68 | argc--; |
| 69 | argv++; | 69 | argv++; |
diff --git a/coreutils/tr.c b/coreutils/tr.c index 3e34e68fa..fd547b87d 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
| @@ -173,7 +173,7 @@ extern int tr_main(int argc, char **argv) | |||
| 173 | input_length = complement(input, input_length); | 173 | input_length = complement(input, input_length); |
| 174 | if (argv[index] != NULL) { | 174 | if (argv[index] != NULL) { |
| 175 | if (*argv[index] == '\0') | 175 | if (*argv[index] == '\0') |
| 176 | fatalError("STRING2 cannot be empty\n"); | 176 | error_msg_and_die("STRING2 cannot be empty\n"); |
| 177 | output_length = expand(argv[index], output); | 177 | output_length = expand(argv[index], output); |
| 178 | map(input, input_length, output, output_length); | 178 | map(input, input_length, output, output_length); |
| 179 | } | 179 | } |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 825fdb562..ff4a9d9e6 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
| @@ -43,7 +43,7 @@ static int read_stduu (const char *inname) | |||
| 43 | char *p; | 43 | char *p; |
| 44 | 44 | ||
| 45 | if (fgets (buf, sizeof(buf), stdin) == NULL) { | 45 | if (fgets (buf, sizeof(buf), stdin) == NULL) { |
| 46 | errorMsg("%s: Short file\n", inname); | 46 | error_msg("%s: Short file\n", inname); |
| 47 | return FALSE; | 47 | return FALSE; |
| 48 | } | 48 | } |
| 49 | p = buf; | 49 | p = buf; |
| @@ -78,7 +78,7 @@ static int read_stduu (const char *inname) | |||
| 78 | 78 | ||
| 79 | if (fgets (buf, sizeof(buf), stdin) == NULL | 79 | if (fgets (buf, sizeof(buf), stdin) == NULL |
| 80 | || strcmp (buf, "end\n")) { | 80 | || strcmp (buf, "end\n")) { |
| 81 | errorMsg("%s: No `end' line\n", inname); | 81 | error_msg("%s: No `end' line\n", inname); |
| 82 | return FALSE; | 82 | return FALSE; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| @@ -128,7 +128,7 @@ static int read_base64 (const char *inname) | |||
| 128 | unsigned char *p; | 128 | unsigned char *p; |
| 129 | 129 | ||
| 130 | if (fgets (buf, sizeof(buf), stdin) == NULL) { | 130 | if (fgets (buf, sizeof(buf), stdin) == NULL) { |
| 131 | errorMsg("%s: Short file\n", inname); | 131 | error_msg("%s: Short file\n", inname); |
| 132 | return FALSE; | 132 | return FALSE; |
| 133 | } | 133 | } |
| 134 | p = buf; | 134 | p = buf; |
| @@ -136,7 +136,7 @@ static int read_base64 (const char *inname) | |||
| 136 | if (memcmp (buf, "====", 4) == 0) | 136 | if (memcmp (buf, "====", 4) == 0) |
| 137 | break; | 137 | break; |
| 138 | if (last_data != 0) { | 138 | if (last_data != 0) { |
| 139 | errorMsg("%s: data following `=' padding character\n", inname); | 139 | error_msg("%s: data following `=' padding character\n", inname); |
| 140 | return FALSE; | 140 | return FALSE; |
| 141 | } | 141 | } |
| 142 | 142 | ||
| @@ -158,14 +158,14 @@ static int read_base64 (const char *inname) | |||
| 158 | 158 | ||
| 159 | while ((b64_tab[*p] & '\100') != 0) | 159 | while ((b64_tab[*p] & '\100') != 0) |
| 160 | if (*p == '\n' || *p++ == '=') { | 160 | if (*p == '\n' || *p++ == '=') { |
| 161 | errorMsg("%s: illegal line\n", inname); | 161 | error_msg("%s: illegal line\n", inname); |
| 162 | return FALSE; | 162 | return FALSE; |
| 163 | } | 163 | } |
| 164 | c2 = b64_tab[*p++]; | 164 | c2 = b64_tab[*p++]; |
| 165 | 165 | ||
| 166 | while (b64_tab[*p] == '\177') | 166 | while (b64_tab[*p] == '\177') |
| 167 | if (*p++ == '\n') { | 167 | if (*p++ == '\n') { |
| 168 | errorMsg("%s: illegal line\n", inname); | 168 | error_msg("%s: illegal line\n", inname); |
| 169 | return FALSE; | 169 | return FALSE; |
| 170 | } | 170 | } |
| 171 | if (*p == '=') { | 171 | if (*p == '=') { |
| @@ -177,7 +177,7 @@ static int read_base64 (const char *inname) | |||
| 177 | 177 | ||
| 178 | while (b64_tab[*p] == '\177') | 178 | while (b64_tab[*p] == '\177') |
| 179 | if (*p++ == '\n') { | 179 | if (*p++ == '\n') { |
| 180 | errorMsg("%s: illegal line\n", inname); | 180 | error_msg("%s: illegal line\n", inname); |
| 181 | return FALSE; | 181 | return FALSE; |
| 182 | } | 182 | } |
| 183 | putchar (c1 << 2 | c2 >> 4); | 183 | putchar (c1 << 2 | c2 >> 4); |
| @@ -209,7 +209,7 @@ static int decode (const char *inname, | |||
| 209 | 209 | ||
| 210 | while (1) { | 210 | while (1) { |
| 211 | if (fgets (buf, sizeof (buf), stdin) == NULL) { | 211 | if (fgets (buf, sizeof (buf), stdin) == NULL) { |
| 212 | errorMsg("%s: No `begin' line\n", inname); | 212 | error_msg("%s: No `begin' line\n", inname); |
| 213 | return FALSE; | 213 | return FALSE; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| @@ -234,13 +234,13 @@ static int decode (const char *inname, | |||
| 234 | while (*p != '/') | 234 | while (*p != '/') |
| 235 | ++p; | 235 | ++p; |
| 236 | if (*p == '\0') { | 236 | if (*p == '\0') { |
| 237 | errorMsg("%s: Illegal ~user\n", inname); | 237 | error_msg("%s: Illegal ~user\n", inname); |
| 238 | return FALSE; | 238 | return FALSE; |
| 239 | } | 239 | } |
| 240 | *p++ = '\0'; | 240 | *p++ = '\0'; |
| 241 | pw = getpwnam (buf + 1); | 241 | pw = getpwnam (buf + 1); |
| 242 | if (pw == NULL) { | 242 | if (pw == NULL) { |
| 243 | errorMsg("%s: No user `%s'\n", inname, buf + 1); | 243 | error_msg("%s: No user `%s'\n", inname, buf + 1); |
| 244 | return FALSE; | 244 | return FALSE; |
| 245 | } | 245 | } |
| 246 | n = strlen (pw->pw_dir); | 246 | n = strlen (pw->pw_dir); |
| @@ -257,7 +257,7 @@ static int decode (const char *inname, | |||
| 257 | && (freopen (outname, "w", stdout) == NULL | 257 | && (freopen (outname, "w", stdout) == NULL |
| 258 | || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | 258 | || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO)) |
| 259 | )) { | 259 | )) { |
| 260 | errorMsg("%s: %s %s\n", outname, inname, strerror(errno)); /* */ | 260 | error_msg("%s: %s %s\n", outname, inname, strerror(errno)); /* */ |
| 261 | return FALSE; | 261 | return FALSE; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| @@ -302,7 +302,7 @@ int uudecode_main (int argc, | |||
| 302 | if (decode (argv[optind], outname) != 0) | 302 | if (decode (argv[optind], outname) != 0) |
| 303 | exit_status = FALSE; | 303 | exit_status = FALSE; |
| 304 | } else { | 304 | } else { |
| 305 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 305 | error_msg("%s: %s\n", argv[optind], strerror(errno)); |
| 306 | exit_status = EXIT_FAILURE; | 306 | exit_status = EXIT_FAILURE; |
| 307 | } | 307 | } |
| 308 | optind++; | 308 | optind++; |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 8d15adbf6..41e659075 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 | errorMsg("Read error\n"); | 145 | error_msg("Read error\n"); |
| 146 | 146 | ||
| 147 | if (trans_ptr == uu_std) { | 147 | if (trans_ptr == uu_std) { |
| 148 | putchar (ENC ('\0')); | 148 | putchar (ENC ('\0')); |
| @@ -178,7 +178,7 @@ int uuencode_main (int argc, | |||
| 178 | case 2: | 178 | case 2: |
| 179 | /* Optional first argument is input file. */ | 179 | /* Optional first argument is input file. */ |
| 180 | if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { | 180 | if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { |
| 181 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 181 | error_msg("%s: %s\n", argv[optind], strerror(errno)); |
| 182 | return EXIT_FAILURE; | 182 | return EXIT_FAILURE; |
| 183 | } | 183 | } |
| 184 | mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); | 184 | mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); |
| @@ -199,7 +199,7 @@ int uuencode_main (int argc, | |||
| 199 | encode(); | 199 | encode(); |
| 200 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); | 200 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); |
| 201 | if (ferror (stdout)) { | 201 | if (ferror (stdout)) { |
| 202 | errorMsg("Write error\n"); | 202 | error_msg("Write error\n"); |
| 203 | return EXIT_FAILURE; | 203 | return EXIT_FAILURE; |
| 204 | } | 204 | } |
| 205 | return EXIT_SUCCESS; | 205 | return EXIT_SUCCESS; |
diff --git a/coreutils/whoami.c b/coreutils/whoami.c index 44fbc950b..6a5dd2c04 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c | |||
| @@ -37,5 +37,5 @@ extern int whoami_main(int argc, char **argv) | |||
| 37 | puts(user); | 37 | puts(user); |
| 38 | return EXIT_SUCCESS; | 38 | return EXIT_SUCCESS; |
| 39 | } | 39 | } |
| 40 | fatalError("cannot find username for UID %u\n", (unsigned) uid); | 40 | error_msg_and_die("cannot find username for UID %u\n", (unsigned) uid); |
| 41 | } | 41 | } |
