aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-07-12 17:02:35 +0000
committerMatt Kraai <kraai@debian.org>2000-07-12 17:02:35 +0000
commitbe84cd4ef66f8956eb4c7ff0542fd1ba823a70e7 (patch)
tree088bc5b6e06d693ad8ca3eba078c0f3a8e302a24 /coreutils
parente58771e73c0d8589a458ede4088f5ba70eff917b (diff)
downloadbusybox-w32-be84cd4ef66f8956eb4c7ff0542fd1ba823a70e7.tar.gz
busybox-w32-be84cd4ef66f8956eb4c7ff0542fd1ba823a70e7.tar.bz2
busybox-w32-be84cd4ef66f8956eb4c7ff0542fd1ba823a70e7.zip
Always report the applet name when doing error reporting.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/chroot.c6
-rw-r--r--coreutils/date.c10
-rw-r--r--coreutils/md5sum.c8
-rw-r--r--coreutils/pwd.c2
-rw-r--r--coreutils/touch.c4
-rw-r--r--coreutils/tr.c2
-rw-r--r--coreutils/uudecode.c4
-rw-r--r--coreutils/uuencode.c2
8 files changed, 18 insertions, 20 deletions
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index 1c64e08a9..95aed3d17 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -47,8 +47,7 @@ int chroot_main(int argc, char **argv)
47 argv++; 47 argv++;
48 48
49 if (chroot(*argv) || (chdir("/"))) { 49 if (chroot(*argv) || (chdir("/"))) {
50 fatalError("chroot: cannot change root directory to %s: %s\n", 50 fatalError("cannot change root directory to %s: %s\n", *argv, strerror(errno));
51 *argv, strerror(errno));
52 } 51 }
53 52
54 argc--; 53 argc--;
@@ -62,8 +61,7 @@ int chroot_main(int argc, char **argv)
62 prog = "/bin/sh"; 61 prog = "/bin/sh";
63 execlp(prog, prog, NULL); 62 execlp(prog, prog, NULL);
64 } 63 }
65 fatalError("chroot: cannot execute %s: %s\n", 64 fatalError("cannot execute %s: %s\n", prog, strerror(errno));
66 prog, strerror(errno));
67 65
68} 66}
69 67
diff --git a/coreutils/date.c b/coreutils/date.c
index 9e8e3f3eb..bc6d13137 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -66,7 +66,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
66 &(tm_time->tm_min), &(tm_time->tm_year)); 66 &(tm_time->tm_min), &(tm_time->tm_year));
67 67
68 if (nr < 4 || nr > 5) { 68 if (nr < 4 || nr > 5) {
69 fatalError(invalid_date, "date", t_string); 69 fatalError(invalid_date, t_string);
70 } 70 }
71 71
72 /* correct for century - minor Y2K problem here? */ 72 /* correct for century - minor Y2K problem here? */
@@ -150,7 +150,7 @@ struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
150 150
151 } 151 }
152 152
153 fatalError(invalid_date, "date", t_string); 153 fatalError(invalid_date, t_string);
154} 154}
155 155
156 156
@@ -186,7 +186,7 @@ int date_main(int argc, char **argv)
186 case 'u': 186 case 'u':
187 utc = 1; 187 utc = 1;
188 if (putenv("TZ=UTC0") != 0) 188 if (putenv("TZ=UTC0") != 0)
189 fatalError(memory_exhausted, "date"); 189 fatalError(memory_exhausted);
190 break; 190 break;
191 case 'd': 191 case 'd':
192 use_arg = 1; 192 use_arg = 1;
@@ -236,12 +236,12 @@ int date_main(int argc, char **argv)
236 /* Correct any day of week and day of year etc fields */ 236 /* Correct any day of week and day of year etc fields */
237 tm = mktime(&tm_time); 237 tm = mktime(&tm_time);
238 if (tm < 0) 238 if (tm < 0)
239 fatalError(invalid_date, "date", date_str); 239 fatalError(invalid_date, date_str);
240 240
241 /* if setting time, set it */ 241 /* if setting time, set it */
242 if (set_time) { 242 if (set_time) {
243 if (stime(&tm) < 0) { 243 if (stime(&tm) < 0) {
244 fatalError("date: can't set date.\n"); 244 fatalError("can't set date.\n");
245 } 245 }
246 } 246 }
247 } 247 }
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index f4a8b99d0..e6f1c86b4 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -708,13 +708,13 @@ static int md5_file(const char *filename,
708 } else { 708 } else {
709 fp = fopen(filename, OPENOPTS(binary)); 709 fp = fopen(filename, OPENOPTS(binary));
710 if (fp == NULL) { 710 if (fp == NULL) {
711 errorMsg("md5sum: %s: %s\n", filename, strerror(errno)); 711 errorMsg("%s: %s\n", filename, strerror(errno));
712 return FALSE; 712 return FALSE;
713 } 713 }
714 } 714 }
715 715
716 if (md5_stream(fp, md5_result)) { 716 if (md5_stream(fp, md5_result)) {
717 errorMsg("md5sum: %s: %s\n", filename, strerror(errno)); 717 errorMsg("%s: %s\n", filename, strerror(errno));
718 718
719 if (fp != stdin) 719 if (fp != stdin)
720 fclose(fp); 720 fclose(fp);
@@ -722,7 +722,7 @@ static int md5_file(const char *filename,
722 } 722 }
723 723
724 if (fp != stdin && fclose(fp) == EOF) { 724 if (fp != stdin && fclose(fp) == EOF) {
725 errorMsg("md5sum: %s: %s\n", filename, strerror(errno)); 725 errorMsg("%s: %s\n", filename, strerror(errno));
726 return FALSE; 726 return FALSE;
727 } 727 }
728 728
@@ -746,7 +746,7 @@ static int md5_check(const char *checkfile_name)
746 } else { 746 } else {
747 checkfile_stream = fopen(checkfile_name, "r"); 747 checkfile_stream = fopen(checkfile_name, "r");
748 if (checkfile_stream == NULL) { 748 if (checkfile_stream == NULL) {
749 errorMsg("md5sum: %s: %s\n", checkfile_name, strerror(errno)); 749 errorMsg("%s: %s\n", checkfile_name, strerror(errno));
750 return FALSE; 750 return FALSE;
751 } 751 }
752 } 752 }
diff --git a/coreutils/pwd.c b/coreutils/pwd.c
index 87553b3de..f0c923b7b 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("pwd: %s\n", strerror(errno)); 34 fatalError("%s\n", strerror(errno));
35 35
36 printf("%s\n", buf); 36 printf("%s\n", buf);
37 return(TRUE); 37 return(TRUE);
diff --git a/coreutils/touch.c b/coreutils/touch.c
index f52bb0284..ac275423c 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -70,12 +70,12 @@ extern int touch_main(int argc, char **argv)
70 if (create == FALSE && errno == ENOENT) 70 if (create == FALSE && errno == ENOENT)
71 exit(TRUE); 71 exit(TRUE);
72 else { 72 else {
73 fatalError("touch: %s", strerror(errno)); 73 fatalError("%s", strerror(errno));
74 } 74 }
75 } 75 }
76 close(fd); 76 close(fd);
77 if (utime(*argv, NULL)) { 77 if (utime(*argv, NULL)) {
78 fatalError("touch: %s", strerror(errno)); 78 fatalError("%s", strerror(errno));
79 } 79 }
80 argc--; 80 argc--;
81 argv++; 81 argv++;
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 5a8116db0..293bbce6b 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -189,7 +189,7 @@ extern int tr_main(int argc, char **argv)
189 complement(input); 189 complement(input);
190 if (argv[index] != NULL) { 190 if (argv[index] != NULL) {
191 if (*argv[index] == '\0') 191 if (*argv[index] == '\0')
192 fatalError("tr: STRING2 cannot be empty\n"); 192 fatalError("STRING2 cannot be empty\n");
193 expand(argv[index], output); 193 expand(argv[index], output);
194 map(input, output); 194 map(input, output);
195 } 195 }
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index ac33762b0..12a71a573 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -286,7 +286,7 @@ static int decode (const char *inname,
286 && (freopen (outname, "w", stdout) == NULL 286 && (freopen (outname, "w", stdout) == NULL
287 || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO)) 287 || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
288 )) { 288 )) {
289 errorMsg("uudeoce %s: %s %s\n", outname, inname, strerror(errno)); /* */ 289 errorMsg("%s: %s %s\n", outname, inname, strerror(errno)); /* */
290 return FALSE; 290 return FALSE;
291 } 291 }
292 292
@@ -340,7 +340,7 @@ int uudecode_main (int argc,
340 if (decode (argv[optind], outname) != 0) 340 if (decode (argv[optind], outname) != 0)
341 exit_status = FALSE; 341 exit_status = FALSE;
342 } else { 342 } else {
343 errorMsg("uudecode: %s: %s\n", argv[optind], strerror(errno)); 343 errorMsg("%s: %s\n", argv[optind], strerror(errno));
344 exit_status = FALSE; 344 exit_status = FALSE;
345 } 345 }
346 optind++; 346 optind++;
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index e4fc1a0bc..e107a01e7 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -217,7 +217,7 @@ int uuencode_main (int argc,
217 case 2: 217 case 2:
218 /* Optional first argument is input file. */ 218 /* Optional first argument is input file. */
219 if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { 219 if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
220 errorMsg("uuencode: %s: %s\n", argv[optind], strerror(errno)); 220 errorMsg("%s: %s\n", argv[optind], strerror(errno));
221 exit FALSE; 221 exit FALSE;
222 } 222 }
223 mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); 223 mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);