summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-10-01 11:58:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-10-01 11:58:38 +0000
commit0c97c9d43707da745fe2bc62ab2a69497ceaf666 (patch)
tree267d0feb99f457b68c09315b3f3aebe8dfd6d411 /coreutils
parentd65ea39ffc7503807fa95e8840c012a80c83e4f3 (diff)
downloadbusybox-w32-0c97c9d43707da745fe2bc62ab2a69497ceaf666.tar.gz
busybox-w32-0c97c9d43707da745fe2bc62ab2a69497ceaf666.tar.bz2
busybox-w32-0c97c9d43707da745fe2bc62ab2a69497ceaf666.zip
'simple' error message functions by Loic Grenie <loic.grenie@gmail.com>.
263 bytes saved.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/chmod.c2
-rw-r--r--coreutils/chown.c2
-rw-r--r--coreutils/dd.c6
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/env.c2
-rw-r--r--coreutils/expand.c2
-rw-r--r--coreutils/fold.c2
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/ln.c6
-rw-r--r--coreutils/ls.c4
-rw-r--r--coreutils/mkfifo.c2
-rw-r--r--coreutils/mknod.c2
-rw-r--r--coreutils/nice.c2
-rw-r--r--coreutils/nohup.c2
-rw-r--r--coreutils/realpath.c2
-rw-r--r--coreutils/split.c2
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/wc.c2
19 files changed, 25 insertions, 25 deletions
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 8b214991a..dd7b78412 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -63,7 +63,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* param, i
63 } 63 }
64 err: 64 err:
65 if (!OPT_QUIET) 65 if (!OPT_QUIET)
66 bb_perror_msg("%s", fileName); 66 bb_simple_perror_msg(fileName);
67 return FALSE; 67 return FALSE;
68} 68}
69 69
diff --git a/coreutils/chown.c b/coreutils/chown.c
index cfd373456..d974493b6 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -57,7 +57,7 @@ static int fileAction(const char *fileName, struct stat *statbuf,
57 return TRUE; 57 return TRUE;
58 } 58 }
59 if (!OPT_QUIET) 59 if (!OPT_QUIET)
60 bb_perror_msg("%s", fileName); /* A filename can have % in it... */ 60 bb_simple_perror_msg(fileName); /* A filename can have % in it... */
61 return FALSE; 61 return FALSE;
62} 62}
63 63
diff --git a/coreutils/dd.c b/coreutils/dd.c
index b17bb5969..b9f5b4cba 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -278,7 +278,7 @@ int dd_main(int argc, char **argv)
278 if (n < 0) { 278 if (n < 0) {
279 if (flags & FLAG_NOERROR) { 279 if (flags & FLAG_NOERROR) {
280 n = ibs; 280 n = ibs;
281 bb_perror_msg("%s", infile); 281 bb_simple_perror_msg(infile);
282 } else 282 } else
283 goto die_infile; 283 goto die_infile;
284 } 284 }
@@ -320,12 +320,12 @@ int dd_main(int argc, char **argv)
320 } 320 }
321 if (close(ifd) < 0) { 321 if (close(ifd) < 0) {
322 die_infile: 322 die_infile:
323 bb_perror_msg_and_die("%s", infile); 323 bb_simple_perror_msg_and_die(infile);
324 } 324 }
325 325
326 if (close(ofd) < 0) { 326 if (close(ofd) < 0) {
327 die_outfile: 327 die_outfile:
328 bb_perror_msg_and_die("%s", outfile); 328 bb_simple_perror_msg_and_die(outfile);
329 } 329 }
330 out_status: 330 out_status:
331 dd_output_status(0); 331 dd_output_status(0);
diff --git a/coreutils/df.c b/coreutils/df.c
index 7eb82cd46..6fe8e2fba 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -100,7 +100,7 @@ int df_main(int argc, char **argv)
100 mount_point = mount_entry->mnt_dir; 100 mount_point = mount_entry->mnt_dir;
101 101
102 if (statfs(mount_point, &s) != 0) { 102 if (statfs(mount_point, &s) != 0) {
103 bb_perror_msg("%s", mount_point); 103 bb_simple_perror_msg(mount_point);
104 goto SET_ERROR; 104 goto SET_ERROR;
105 } 105 }
106 106
diff --git a/coreutils/du.c b/coreutils/du.c
index b5e68d8f8..2697acf13 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -67,7 +67,7 @@ static unsigned long du(const char *filename)
67 unsigned long sum; 67 unsigned long sum;
68 68
69 if (lstat(filename, &statbuf) != 0) { 69 if (lstat(filename, &statbuf) != 0) {
70 bb_perror_msg("%s", filename); 70 bb_simple_perror_msg(filename);
71 G.status = EXIT_FAILURE; 71 G.status = EXIT_FAILURE;
72 return 0; 72 return 0;
73 } 73 }
@@ -85,7 +85,7 @@ static unsigned long du(const char *filename)
85 if (S_ISLNK(statbuf.st_mode)) { 85 if (S_ISLNK(statbuf.st_mode)) {
86 if (G.slink_depth > G.du_depth) { /* -H or -L */ 86 if (G.slink_depth > G.du_depth) { /* -H or -L */
87 if (stat(filename, &statbuf) != 0) { 87 if (stat(filename, &statbuf) != 0) {
88 bb_perror_msg("%s", filename); 88 bb_simple_perror_msg(filename);
89 G.status = EXIT_FAILURE; 89 G.status = EXIT_FAILURE;
90 return 0; 90 return 0;
91 } 91 }
diff --git a/coreutils/env.c b/coreutils/env.c
index 8d2d881fa..5d0cd8256 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -81,7 +81,7 @@ int env_main(int argc, char** argv)
81 BB_EXECVP(*argv, argv); 81 BB_EXECVP(*argv, argv);
82 /* SUSv3-mandated exit codes. */ 82 /* SUSv3-mandated exit codes. */
83 xfunc_error_retval = (errno == ENOENT) ? 127 : 126; 83 xfunc_error_retval = (errno == ENOENT) ? 127 : 126;
84 bb_perror_msg_and_die("%s", *argv); 84 bb_simple_perror_msg_and_die(*argv);
85 } 85 }
86 86
87 for (ep = environ; *ep; ep++) { 87 for (ep = environ; *ep; ep++) {
diff --git a/coreutils/expand.c b/coreutils/expand.c
index 274753fd4..0ef106dbf 100644
--- a/coreutils/expand.c
+++ b/coreutils/expand.c
@@ -192,7 +192,7 @@ int expand_main(int argc, char **argv)
192 /* Check and close the file */ 192 /* Check and close the file */
193 /* We do want all of them to execute, thus | instead of || */ 193 /* We do want all of them to execute, thus | instead of || */
194 if (ferror(file) | fclose_if_not_stdin(file)) { 194 if (ferror(file) | fclose_if_not_stdin(file)) {
195 bb_perror_msg("%s", *argv); 195 bb_simple_perror_msg(*argv);
196 exit_status = EXIT_FAILURE; 196 exit_status = EXIT_FAILURE;
197 } 197 }
198 /* If stdin also clear EOF */ 198 /* If stdin also clear EOF */
diff --git a/coreutils/fold.c b/coreutils/fold.c
index a75f4666e..bf4b19831 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -145,7 +145,7 @@ int fold_main(int argc, char **argv)
145 } 145 }
146 146
147 if (ferror(istream) || fclose_if_not_stdin(istream)) { 147 if (ferror(istream) || fclose_if_not_stdin(istream)) {
148 bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */ 148 bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
149 errs |= EXIT_FAILURE; 149 errs |= EXIT_FAILURE;
150 } 150 }
151 } while (*++argv); 151 } while (*++argv);
diff --git a/coreutils/head.c b/coreutils/head.c
index a48f147a2..af9e9f41e 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -128,7 +128,7 @@ int head_main(int argc, char **argv)
128 putchar(c); 128 putchar(c);
129 } 129 }
130 if (fclose_if_not_stdin(fp)) { 130 if (fclose_if_not_stdin(fp)) {
131 bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */ 131 bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
132 retval = EXIT_FAILURE; 132 retval = EXIT_FAILURE;
133 } 133 }
134 die_if_ferror_stdout(); 134 die_if_ferror_stdout();
diff --git a/coreutils/ln.c b/coreutils/ln.c
index f3c67aa36..658e32e94 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -64,7 +64,7 @@ int ln_main(int argc, char **argv)
64 if (!(flag & LN_SYMLINK) && stat(*argv, &statbuf)) { 64 if (!(flag & LN_SYMLINK) && stat(*argv, &statbuf)) {
65 // coreutils: "ln dangling_symlink new_hardlink" works 65 // coreutils: "ln dangling_symlink new_hardlink" works
66 if (lstat(*argv, &statbuf) || !S_ISLNK(statbuf.st_mode)) { 66 if (lstat(*argv, &statbuf) || !S_ISLNK(statbuf.st_mode)) {
67 bb_perror_msg("%s", *argv); 67 bb_simple_perror_msg(*argv);
68 status = EXIT_FAILURE; 68 status = EXIT_FAILURE;
69 free(src_name); 69 free(src_name);
70 continue; 70 continue;
@@ -75,7 +75,7 @@ int ln_main(int argc, char **argv)
75 char *backup; 75 char *backup;
76 backup = xasprintf("%s%s", src, suffix); 76 backup = xasprintf("%s%s", src, suffix);
77 if (rename(src, backup) < 0 && errno != ENOENT) { 77 if (rename(src, backup) < 0 && errno != ENOENT) {
78 bb_perror_msg("%s", src); 78 bb_simple_perror_msg(src);
79 status = EXIT_FAILURE; 79 status = EXIT_FAILURE;
80 free(backup); 80 free(backup);
81 continue; 81 continue;
@@ -97,7 +97,7 @@ int ln_main(int argc, char **argv)
97 } 97 }
98 98
99 if (link_func(*argv, src) != 0) { 99 if (link_func(*argv, src) != 0) {
100 bb_perror_msg("%s", src); 100 bb_simple_perror_msg(src);
101 status = EXIT_FAILURE; 101 status = EXIT_FAILURE;
102 } 102 }
103 103
diff --git a/coreutils/ls.c b/coreutils/ls.c
index a4acc98ad..92a9a289d 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -171,7 +171,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
171 } 171 }
172#endif 172#endif
173 if (stat(fullname, &dstat)) { 173 if (stat(fullname, &dstat)) {
174 bb_perror_msg("%s", fullname); 174 bb_simple_perror_msg(fullname);
175 status = EXIT_FAILURE; 175 status = EXIT_FAILURE;
176 return 0; 176 return 0;
177 } 177 }
@@ -182,7 +182,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
182 } 182 }
183#endif 183#endif
184 if (lstat(fullname, &dstat)) { 184 if (lstat(fullname, &dstat)) {
185 bb_perror_msg("%s", fullname); 185 bb_simple_perror_msg(fullname);
186 status = EXIT_FAILURE; 186 status = EXIT_FAILURE;
187 return 0; 187 return 0;
188 } 188 }
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index 030c9d22f..e66f81778 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -28,7 +28,7 @@ int mkfifo_main(int argc, char **argv)
28 28
29 do { 29 do {
30 if (mkfifo(*argv, mode) < 0) { 30 if (mkfifo(*argv, mode) < 0) {
31 bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */ 31 bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
32 retval = EXIT_FAILURE; 32 retval = EXIT_FAILURE;
33 } 33 }
34 } while (*++argv); 34 } while (*++argv);
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index ea6f24ae6..a876daaf1 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -44,7 +44,7 @@ int mknod_main(int argc, char **argv)
44 if (mknod(name, mode, dev) == 0) { 44 if (mknod(name, mode, dev) == 0) {
45 return EXIT_SUCCESS; 45 return EXIT_SUCCESS;
46 } 46 }
47 bb_perror_msg_and_die("%s", name); 47 bb_simple_perror_msg_and_die(name);
48 } 48 }
49 } 49 }
50 bb_show_usage(); 50 bb_show_usage();
diff --git a/coreutils/nice.c b/coreutils/nice.c
index 8d77ae472..0cb31e4fa 100644
--- a/coreutils/nice.c
+++ b/coreutils/nice.c
@@ -51,5 +51,5 @@ int nice_main(int argc, char **argv)
51 51
52 /* The exec failed... */ 52 /* The exec failed... */
53 xfunc_error_retval = (errno == ENOENT) ? 127 : 126; /* SUSv3 */ 53 xfunc_error_retval = (errno == ENOENT) ? 127 : 126; /* SUSv3 */
54 bb_perror_msg_and_die("%s", *argv); 54 bb_simple_perror_msg_and_die(*argv);
55} 55}
diff --git a/coreutils/nohup.c b/coreutils/nohup.c
index 22419b800..e27bd2e35 100644
--- a/coreutils/nohup.c
+++ b/coreutils/nohup.c
@@ -56,5 +56,5 @@ int nohup_main(int argc, char **argv)
56 BB_EXECVP(argv[1], argv+1); 56 BB_EXECVP(argv[1], argv+1);
57 if (ENABLE_FEATURE_CLEAN_UP && home) 57 if (ENABLE_FEATURE_CLEAN_UP && home)
58 free((char*)nohupout); 58 free((char*)nohupout);
59 bb_perror_msg_and_die("%s", argv[1]); 59 bb_simple_perror_msg_and_die(argv[1]);
60} 60}
diff --git a/coreutils/realpath.c b/coreutils/realpath.c
index 7c5dc3b10..9c4298720 100644
--- a/coreutils/realpath.c
+++ b/coreutils/realpath.c
@@ -35,7 +35,7 @@ int realpath_main(int argc, char **argv)
35 puts(resolved_path); 35 puts(resolved_path);
36 } else { 36 } else {
37 retval = EXIT_FAILURE; 37 retval = EXIT_FAILURE;
38 bb_perror_msg("%s", *argv); 38 bb_simple_perror_msg(*argv);
39 } 39 }
40 } while (--argc); 40 } while (--argc);
41 41
diff --git a/coreutils/split.c b/coreutils/split.c
index 3ec539a6a..6d8924aeb 100644
--- a/coreutils/split.c
+++ b/coreutils/split.c
@@ -104,7 +104,7 @@ int split_main(int argc, char **argv)
104 if (!bytes_read) 104 if (!bytes_read)
105 break; 105 break;
106 if (bytes_read < 0) 106 if (bytes_read < 0)
107 bb_perror_msg_and_die("%s", argv[0]); 107 bb_simple_perror_msg_and_die(argv[0]);
108 src = read_buffer; 108 src = read_buffer;
109 do { 109 do {
110 if (!remaining) { 110 if (!remaining) {
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 7a1dd3599..d8498d854 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -49,7 +49,7 @@ int touch_main(int argc, char **argv)
49 } 49 }
50 } 50 }
51 status = EXIT_FAILURE; 51 status = EXIT_FAILURE;
52 bb_perror_msg("%s", *argv); 52 bb_simple_perror_msg(*argv);
53 } 53 }
54 } while (*++argv); 54 } while (*++argv);
55 55
diff --git a/coreutils/wc.c b/coreutils/wc.c
index e86b7d4d2..c8a4865b1 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -150,7 +150,7 @@ int wc_main(int argc, char **argv)
150 } 150 }
151 } else if (c == EOF) { 151 } else if (c == EOF) {
152 if (ferror(fp)) { 152 if (ferror(fp)) {
153 bb_perror_msg("%s", arg); 153 bb_simple_perror_msg(arg);
154 status = EXIT_FAILURE; 154 status = EXIT_FAILURE;
155 } 155 }
156 --counts[WC_CHARS]; 156 --counts[WC_CHARS];