'simple' error message functions by Loic Grenie <loic.grenie@gmail.com>.
263 bytes saved.
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 8b21499..dd7b784 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -63,7 +63,7 @@
}
err:
if (!OPT_QUIET)
- bb_perror_msg("%s", fileName);
+ bb_simple_perror_msg(fileName);
return FALSE;
}
diff --git a/coreutils/chown.c b/coreutils/chown.c
index cfd3734..d974493 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -57,7 +57,7 @@
return TRUE;
}
if (!OPT_QUIET)
- bb_perror_msg("%s", fileName); /* A filename can have % in it... */
+ bb_simple_perror_msg(fileName); /* A filename can have % in it... */
return FALSE;
}
diff --git a/coreutils/dd.c b/coreutils/dd.c
index b17bb59..b9f5b4c 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -278,7 +278,7 @@
if (n < 0) {
if (flags & FLAG_NOERROR) {
n = ibs;
- bb_perror_msg("%s", infile);
+ bb_simple_perror_msg(infile);
} else
goto die_infile;
}
@@ -320,12 +320,12 @@
}
if (close(ifd) < 0) {
die_infile:
- bb_perror_msg_and_die("%s", infile);
+ bb_simple_perror_msg_and_die(infile);
}
if (close(ofd) < 0) {
die_outfile:
- bb_perror_msg_and_die("%s", outfile);
+ bb_simple_perror_msg_and_die(outfile);
}
out_status:
dd_output_status(0);
diff --git a/coreutils/df.c b/coreutils/df.c
index 7eb82cd..6fe8e2f 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -100,7 +100,7 @@
mount_point = mount_entry->mnt_dir;
if (statfs(mount_point, &s) != 0) {
- bb_perror_msg("%s", mount_point);
+ bb_simple_perror_msg(mount_point);
goto SET_ERROR;
}
diff --git a/coreutils/du.c b/coreutils/du.c
index b5e68d8..2697acf 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -67,7 +67,7 @@
unsigned long sum;
if (lstat(filename, &statbuf) != 0) {
- bb_perror_msg("%s", filename);
+ bb_simple_perror_msg(filename);
G.status = EXIT_FAILURE;
return 0;
}
@@ -85,7 +85,7 @@
if (S_ISLNK(statbuf.st_mode)) {
if (G.slink_depth > G.du_depth) { /* -H or -L */
if (stat(filename, &statbuf) != 0) {
- bb_perror_msg("%s", filename);
+ bb_simple_perror_msg(filename);
G.status = EXIT_FAILURE;
return 0;
}
diff --git a/coreutils/env.c b/coreutils/env.c
index 8d2d881..5d0cd82 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -81,7 +81,7 @@
BB_EXECVP(*argv, argv);
/* SUSv3-mandated exit codes. */
xfunc_error_retval = (errno == ENOENT) ? 127 : 126;
- bb_perror_msg_and_die("%s", *argv);
+ bb_simple_perror_msg_and_die(*argv);
}
for (ep = environ; *ep; ep++) {
diff --git a/coreutils/expand.c b/coreutils/expand.c
index 274753f..0ef106d 100644
--- a/coreutils/expand.c
+++ b/coreutils/expand.c
@@ -192,7 +192,7 @@
/* Check and close the file */
/* We do want all of them to execute, thus | instead of || */
if (ferror(file) | fclose_if_not_stdin(file)) {
- bb_perror_msg("%s", *argv);
+ bb_simple_perror_msg(*argv);
exit_status = EXIT_FAILURE;
}
/* If stdin also clear EOF */
diff --git a/coreutils/fold.c b/coreutils/fold.c
index a75f466..bf4b198 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -145,7 +145,7 @@
}
if (ferror(istream) || fclose_if_not_stdin(istream)) {
- bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
+ bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
errs |= EXIT_FAILURE;
}
} while (*++argv);
diff --git a/coreutils/head.c b/coreutils/head.c
index a48f147..af9e9f4 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -128,7 +128,7 @@
putchar(c);
}
if (fclose_if_not_stdin(fp)) {
- bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
+ bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
retval = EXIT_FAILURE;
}
die_if_ferror_stdout();
diff --git a/coreutils/ln.c b/coreutils/ln.c
index f3c67aa..658e32e 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -64,7 +64,7 @@
if (!(flag & LN_SYMLINK) && stat(*argv, &statbuf)) {
// coreutils: "ln dangling_symlink new_hardlink" works
if (lstat(*argv, &statbuf) || !S_ISLNK(statbuf.st_mode)) {
- bb_perror_msg("%s", *argv);
+ bb_simple_perror_msg(*argv);
status = EXIT_FAILURE;
free(src_name);
continue;
@@ -75,7 +75,7 @@
char *backup;
backup = xasprintf("%s%s", src, suffix);
if (rename(src, backup) < 0 && errno != ENOENT) {
- bb_perror_msg("%s", src);
+ bb_simple_perror_msg(src);
status = EXIT_FAILURE;
free(backup);
continue;
@@ -97,7 +97,7 @@
}
if (link_func(*argv, src) != 0) {
- bb_perror_msg("%s", src);
+ bb_simple_perror_msg(src);
status = EXIT_FAILURE;
}
diff --git a/coreutils/ls.c b/coreutils/ls.c
index a4acc98..92a9a28 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -171,7 +171,7 @@
}
#endif
if (stat(fullname, &dstat)) {
- bb_perror_msg("%s", fullname);
+ bb_simple_perror_msg(fullname);
status = EXIT_FAILURE;
return 0;
}
@@ -182,7 +182,7 @@
}
#endif
if (lstat(fullname, &dstat)) {
- bb_perror_msg("%s", fullname);
+ bb_simple_perror_msg(fullname);
status = EXIT_FAILURE;
return 0;
}
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index 030c9d2..e66f817 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -28,7 +28,7 @@
do {
if (mkfifo(*argv, mode) < 0) {
- bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
+ bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
retval = EXIT_FAILURE;
}
} while (*++argv);
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index ea6f24a..a876daa 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -44,7 +44,7 @@
if (mknod(name, mode, dev) == 0) {
return EXIT_SUCCESS;
}
- bb_perror_msg_and_die("%s", name);
+ bb_simple_perror_msg_and_die(name);
}
}
bb_show_usage();
diff --git a/coreutils/nice.c b/coreutils/nice.c
index 8d77ae4..0cb31e4 100644
--- a/coreutils/nice.c
+++ b/coreutils/nice.c
@@ -51,5 +51,5 @@
/* The exec failed... */
xfunc_error_retval = (errno == ENOENT) ? 127 : 126; /* SUSv3 */
- bb_perror_msg_and_die("%s", *argv);
+ bb_simple_perror_msg_and_die(*argv);
}
diff --git a/coreutils/nohup.c b/coreutils/nohup.c
index 22419b8..e27bd2e 100644
--- a/coreutils/nohup.c
+++ b/coreutils/nohup.c
@@ -56,5 +56,5 @@
BB_EXECVP(argv[1], argv+1);
if (ENABLE_FEATURE_CLEAN_UP && home)
free((char*)nohupout);
- bb_perror_msg_and_die("%s", argv[1]);
+ bb_simple_perror_msg_and_die(argv[1]);
}
diff --git a/coreutils/realpath.c b/coreutils/realpath.c
index 7c5dc3b..9c42987 100644
--- a/coreutils/realpath.c
+++ b/coreutils/realpath.c
@@ -35,7 +35,7 @@
puts(resolved_path);
} else {
retval = EXIT_FAILURE;
- bb_perror_msg("%s", *argv);
+ bb_simple_perror_msg(*argv);
}
} while (--argc);
diff --git a/coreutils/split.c b/coreutils/split.c
index 3ec539a..6d8924a 100644
--- a/coreutils/split.c
+++ b/coreutils/split.c
@@ -104,7 +104,7 @@
if (!bytes_read)
break;
if (bytes_read < 0)
- bb_perror_msg_and_die("%s", argv[0]);
+ bb_simple_perror_msg_and_die(argv[0]);
src = read_buffer;
do {
if (!remaining) {
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 7a1dd35..d8498d8 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -49,7 +49,7 @@
}
}
status = EXIT_FAILURE;
- bb_perror_msg("%s", *argv);
+ bb_simple_perror_msg(*argv);
}
} while (*++argv);
diff --git a/coreutils/wc.c b/coreutils/wc.c
index e86b7d4..c8a4865 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -150,7 +150,7 @@
}
} else if (c == EOF) {
if (ferror(fp)) {
- bb_perror_msg("%s", arg);
+ bb_simple_perror_msg(arg);
status = EXIT_FAILURE;
}
--counts[WC_CHARS];