summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorJames Byrne2019-07-02 11:35:03 +0200
committerDenys Vlasenko2019-07-02 11:35:03 +0200
commit6937487be73cd4563b876413277a295a5fe2f32c (patch)
treef16cc9999a7c827891e6ec8d99c699fc791008ee /coreutils
parentcaecfdc20d450686cd1f7e9b5f650322f894b3c2 (diff)
downloadbusybox-6937487be73cd4563b876413277a295a5fe2f32c.zip
busybox-6937487be73cd4563b876413277a295a5fe2f32c.tar.gz
libbb: reduce the overhead of single parameter bb_error_msg() calls
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cp.c4
-rw-r--r--coreutils/cut.c6
-rw-r--r--coreutils/date.c2
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/echo.c2
-rw-r--r--coreutils/env.c2
-rw-r--r--coreutils/expand.c2
-rw-r--r--coreutils/expr.c16
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/install.c2
-rw-r--r--coreutils/ln.c2
-rw-r--r--coreutils/logname.c2
-rw-r--r--coreutils/md5_sha1_sum.c2
-rw-r--r--coreutils/od_bloaty.c12
-rw-r--r--coreutils/paste.c2
-rw-r--r--coreutils/printf.c2
-rw-r--r--coreutils/rm.c2
-rw-r--r--coreutils/sort.c12
-rw-r--r--coreutils/split.c4
-rw-r--r--coreutils/stty.c6
-rw-r--r--coreutils/tail.c4
-rw-r--r--coreutils/test.c4
-rw-r--r--coreutils/tr.c4
-rw-r--r--coreutils/uudecode.c8
-rw-r--r--coreutils/uuencode.c2
25 files changed, 54 insertions, 54 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index 59e3d2f..cfeb19f 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -217,7 +217,7 @@ int cp_main(int argc, char **argv)
// flags, FILEUTILS_RMDEST, OPT_parents);
if (flags & OPT_parents) {
if (!(d_flags & 2)) {
- bb_error_msg_and_die("with --parents, the destination must be a directory");
+ bb_simple_error_msg_and_die("with --parents, the destination must be a directory");
}
}
if (flags & FILEUTILS_RMDEST) {
@@ -236,7 +236,7 @@ int cp_main(int argc, char **argv)
goto DO_COPY; /* NB: argc==2 -> *++argv==last */
}
} else if (flags & FILEUTILS_NO_TARGET_DIR) {
- bb_error_msg_and_die("too many arguments");
+ bb_simple_error_msg_and_die("too many arguments");
}
while (1) {
diff --git a/coreutils/cut.c b/coreutils/cut.c
index e952dc1..1acbb51 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -209,11 +209,11 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
// argc -= optind;
argv += optind;
if (!(opt & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS)))
- bb_error_msg_and_die("expected a list of bytes, characters, or fields");
+ bb_simple_error_msg_and_die("expected a list of bytes, characters, or fields");
if (opt & CUT_OPT_DELIM_FLGS) {
if (ltok[0] && ltok[1]) { /* more than 1 char? */
- bb_error_msg_and_die("the delimiter must be a single character");
+ bb_simple_error_msg_and_die("the delimiter must be a single character");
}
delim = ltok[0];
}
@@ -288,7 +288,7 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
/* make sure we got some cut positions out of all that */
if (nlists == 0)
- bb_error_msg_and_die("missing list of positions");
+ bb_simple_error_msg_and_die("missing list of positions");
/* now that the lists are parsed, we need to sort them to make life
* easier on us when it comes time to print the chars / fields / lines
diff --git a/coreutils/date.c b/coreutils/date.c
index 3414d38..feb4004 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -304,7 +304,7 @@ int date_main(int argc UNUSED_PARAM, char **argv)
/* if setting time, set it */
if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
- bb_perror_msg("can't set date");
+ bb_simple_perror_msg("can't set date");
}
}
diff --git a/coreutils/df.c b/coreutils/df.c
index f6d66e4..debb868 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -178,7 +178,7 @@ int df_main(int argc UNUSED_PARAM, char **argv)
if (!argv[0]) {
mount_table = setmntent(bb_path_mtab_file, "r");
if (!mount_table)
- bb_perror_msg_and_die(bb_path_mtab_file);
+ bb_simple_perror_msg_and_die(bb_path_mtab_file);
}
while (1) {
diff --git a/coreutils/echo.c b/coreutils/echo.c
index 5dc5be0..b382889 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -188,7 +188,7 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
/*r =*/ full_write(STDOUT_FILENO, buffer, out - buffer);
free(buffer);
if (/*WRONG:r < 0*/ errno) {
- bb_perror_msg(bb_msg_write_error);
+ bb_simple_perror_msg(bb_msg_write_error);
return 1;
}
return 0;
diff --git a/coreutils/env.c b/coreutils/env.c
index 878068f..c37c0c2 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -79,7 +79,7 @@ int env_main(int argc UNUSED_PARAM, char **argv)
while (*argv && (strchr(*argv, '=') != NULL)) {
if (putenv(*argv) < 0) {
- bb_perror_msg_and_die("putenv");
+ bb_simple_perror_msg_and_die("putenv");
}
++argv;
}
diff --git a/coreutils/expand.c b/coreutils/expand.c
index 20e4c4b..4fa974d 100644
--- a/coreutils/expand.c
+++ b/coreutils/expand.c
@@ -247,7 +247,7 @@ int expand_main(int argc UNUSED_PARAM, char **argv)
/* Now close stdin also */
/* (if we didn't read from it, it's a no-op) */
if (fclose(stdin))
- bb_perror_msg_and_die(bb_msg_standard_input);
+ bb_simple_perror_msg_and_die(bb_msg_standard_input);
fflush_stdout_and_exit(exit_status);
}
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 1bdfba0..b247f08 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -249,7 +249,7 @@ static arith_t arithmetic_common(VALUE *l, VALUE *r, int op)
arith_t li, ri;
if (!toarith(l) || !toarith(r))
- bb_error_msg_and_die("non-numeric argument");
+ bb_simple_error_msg_and_die("non-numeric argument");
li = l->u.i;
ri = r->u.i;
if (op == '+')
@@ -259,7 +259,7 @@ static arith_t arithmetic_common(VALUE *l, VALUE *r, int op)
if (op == '*')
return li * ri;
if (ri == 0)
- bb_error_msg_and_die("division by zero");
+ bb_simple_error_msg_and_die("division by zero");
if (op == '/')
return li / ri;
return li % ri;
@@ -319,19 +319,19 @@ static VALUE *eval7(void)
VALUE *v;
if (!*G.args)
- bb_error_msg_and_die("syntax error");
+ bb_simple_error_msg_and_die("syntax error");
if (nextarg("(")) {
G.args++;
v = eval();
if (!nextarg(")"))
- bb_error_msg_and_die("syntax error");
+ bb_simple_error_msg_and_die("syntax error");
G.args++;
return v;
}
if (nextarg(")"))
- bb_error_msg_and_die("syntax error");
+ bb_simple_error_msg_and_die("syntax error");
return str_value(*G.args++);
}
@@ -353,7 +353,7 @@ static VALUE *eval6(void)
G.args++; /* We have a valid token, so get the next argument. */
if (key == 1) { /* quote */
if (!*G.args)
- bb_error_msg_and_die("syntax error");
+ bb_simple_error_msg_and_die("syntax error");
return str_value(*G.args++);
}
if (key == 2) { /* length */
@@ -546,11 +546,11 @@ int expr_main(int argc UNUSED_PARAM, char **argv)
xfunc_error_retval = 2; /* coreutils compat */
G.args = argv + 1;
if (*G.args == NULL) {
- bb_error_msg_and_die("too few arguments");
+ bb_simple_error_msg_and_die("too few arguments");
}
v = eval();
if (*G.args)
- bb_error_msg_and_die("syntax error");
+ bb_simple_error_msg_and_die("syntax error");
if (v->type == INTEGER)
printf("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i);
else
diff --git a/coreutils/id.c b/coreutils/id.c
index 00c0cd8..f20cd7d 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -231,7 +231,7 @@ int id_main(int argc UNUSED_PARAM, char **argv)
}
} else if (n < 0) { /* error in get_groups() */
if (ENABLE_DESKTOP)
- bb_error_msg_and_die("can't get groups");
+ bb_simple_error_msg_and_die("can't get groups");
return EXIT_FAILURE;
}
if (ENABLE_FEATURE_CLEAN_UP)
diff --git a/coreutils/install.c b/coreutils/install.c
index 8270490..c0f1c53 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -238,7 +238,7 @@ int install_main(int argc, char **argv)
args[2] = dest;
args[3] = NULL;
if (spawn_and_wait(args)) {
- bb_perror_msg("strip");
+ bb_simple_perror_msg("strip");
ret = EXIT_FAILURE;
}
}
diff --git a/coreutils/ln.c b/coreutils/ln.c
index afeb0d7..ea2d10e 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -69,7 +69,7 @@ int ln_main(int argc, char **argv)
argc -= optind;
if ((opts & LN_LINKFILE) && argc > 2) {
- bb_error_msg_and_die("-T accepts 2 args max");
+ bb_simple_error_msg_and_die("-T accepts 2 args max");
}
if (!argv[1]) {
diff --git a/coreutils/logname.c b/coreutils/logname.c
index 31ce61f..06bbe1b 100644
--- a/coreutils/logname.c
+++ b/coreutils/logname.c
@@ -56,5 +56,5 @@ int logname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
return fflush_all();
}
- bb_perror_msg_and_die("getlogin");
+ bb_simple_perror_msg_and_die("getlogin");
}
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 538df25..ba26c98 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -300,7 +300,7 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
}
if (filename_ptr == NULL) {
if (flags & FLAG_WARN) {
- bb_error_msg("invalid format");
+ bb_simple_error_msg("invalid format");
}
count_failed++;
return_value = EXIT_FAILURE;
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c
index 4cae0c5..e9c071f 100644
--- a/coreutils/od_bloaty.c
+++ b/coreutils/od_bloaty.c
@@ -536,7 +536,7 @@ check_and_close(void)
}
if (ferror(stdout)) {
- bb_error_msg_and_die(bb_msg_write_error);
+ bb_simple_error_msg_and_die(bb_msg_write_error);
}
}
@@ -841,7 +841,7 @@ skip(off_t n_skip)
}
if (n_skip)
- bb_error_msg_and_die("can't skip past end of combined input");
+ bb_simple_error_msg_and_die("can't skip past end of combined input");
}
@@ -1308,10 +1308,10 @@ int od_main(int argc UNUSED_PARAM, char **argv)
pseudo_start = o2;
argv[1] = NULL;
} else {
- bb_error_msg_and_die("the last two arguments must be offsets");
+ bb_simple_error_msg_and_die("the last two arguments must be offsets");
}
} else { /* >3 args */
- bb_error_msg_and_die("too many arguments");
+ bb_simple_error_msg_and_die("too many arguments");
}
if (pseudo_start >= 0) {
@@ -1332,7 +1332,7 @@ int od_main(int argc UNUSED_PARAM, char **argv)
if (option_mask32 & OPT_N) {
end_offset = n_bytes_to_skip + max_bytes_to_format;
if (end_offset < n_bytes_to_skip)
- bb_error_msg_and_die("SKIP + SIZE is too large");
+ bb_simple_error_msg_and_die("SKIP + SIZE is too large");
}
if (G.n_specs == 0) {
@@ -1389,7 +1389,7 @@ int od_main(int argc UNUSED_PARAM, char **argv)
dump(n_bytes_to_skip, end_offset);
if (fclose(stdin))
- bb_perror_msg_and_die(bb_msg_standard_input);
+ bb_simple_perror_msg_and_die(bb_msg_standard_input);
return G.exit_code;
}
diff --git a/coreutils/paste.c b/coreutils/paste.c
index 3d81a5f..1174329 100644
--- a/coreutils/paste.c
+++ b/coreutils/paste.c
@@ -116,7 +116,7 @@ int paste_main(int argc UNUSED_PARAM, char **argv)
if (opt & PASTE_OPT_DELIMITERS) {
if (!delims[0])
- bb_error_msg_and_die("-d '' is not supported");
+ bb_simple_error_msg_and_die("-d '' is not supported");
/* unknown mappings are not changed: "\z" -> '\\' 'z' */
/* trailing backslash, if any, is preserved */
del_cnt = strcpy_and_process_escape_sequences(delims, delims) - delims;
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 5cf5186..a20fc33 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -430,7 +430,7 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
if (ENABLE_ASH_PRINTF
&& applet_name[0] != 'p'
) {
- bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
+ bb_simple_error_msg("usage: printf FORMAT [ARGUMENT...]");
return 2; /* bash compat */
}
bb_show_usage();
diff --git a/coreutils/rm.c b/coreutils/rm.c
index fd94bb5..d000129 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -62,7 +62,7 @@ int rm_main(int argc UNUSED_PARAM, char **argv)
const char *base = bb_get_last_path_component_strip(*argv);
if (DOT_OR_DOTDOT(base)) {
- bb_error_msg("can't remove '.' or '..'");
+ bb_simple_error_msg("can't remove '.' or '..'");
} else if (remove_file(*argv, flags) >= 0) {
continue;
}
diff --git a/coreutils/sort.c b/coreutils/sort.c
index f04c606..07c3276 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -277,7 +277,7 @@ static int compare_keys(const void *xarg, const void *yarg)
/* Perform actual comparison */
switch (flags & (FLAG_n | FLAG_g | FLAG_M | FLAG_V)) {
default:
- bb_error_msg_and_die("unknown sort type");
+ bb_simple_error_msg_and_die("unknown sort type");
break;
#if defined(HAVE_STRVERSCMP) && HAVE_STRVERSCMP == 1
case FLAG_V:
@@ -398,10 +398,10 @@ static unsigned str2u(char **str)
{
unsigned long lu;
if (!isdigit((*str)[0]))
- bb_error_msg_and_die("bad field specification");
+ bb_simple_error_msg_and_die("bad field specification");
lu = strtoul(*str, str, 10);
if ((sizeof(long) > sizeof(int) && lu > INT_MAX) || !lu)
- bb_error_msg_and_die("bad field specification");
+ bb_simple_error_msg_and_die("bad field specification");
return lu;
}
#endif
@@ -461,7 +461,7 @@ int sort_main(int argc UNUSED_PARAM, char **argv)
#if ENABLE_FEATURE_SORT_BIG
if (opts & FLAG_t) {
if (!str_t[0] || str_t[1])
- bb_error_msg_and_die("bad -t parameter");
+ bb_simple_error_msg_and_die("bad -t parameter");
key_separator = str_t[0];
}
/* note: below this point we use option_mask32, not opts,
@@ -504,10 +504,10 @@ int sort_main(int argc UNUSED_PARAM, char **argv)
because comma isn't in OPT_STR */
idx = strchr(OPT_STR, *str_k);
if (!idx)
- bb_error_msg_and_die("unknown key option");
+ bb_simple_error_msg_and_die("unknown key option");
flag = 1 << (idx - OPT_STR);
if (flag & ~FLAG_allowed_for_k)
- bb_error_msg_and_die("unknown sort type");
+ bb_simple_error_msg_and_die("unknown sort type");
/* b after ',' means strip _trailing_ space */
if (i && flag == FLAG_b)
flag = FLAG_bb;
diff --git a/coreutils/split.c b/coreutils/split.c
index c1e4cea..ecbc9d2 100644
--- a/coreutils/split.c
+++ b/coreutils/split.c
@@ -127,7 +127,7 @@ int split_main(int argc UNUSED_PARAM, char **argv)
}
if (NAME_MAX < strlen(sfx) + suffix_len)
- bb_error_msg_and_die("suffix too long");
+ bb_simple_error_msg_and_die("suffix too long");
{
char *char_p = xzalloc(suffix_len + 1);
@@ -147,7 +147,7 @@ int split_main(int argc UNUSED_PARAM, char **argv)
do {
if (!remaining) {
if (!pfx)
- bb_error_msg_and_die("suffixes exhausted");
+ bb_simple_error_msg_and_die("suffixes exhausted");
xmove_fd(xopen(pfx, O_WRONLY | O_CREAT | O_TRUNC), 1);
pfx = next_file(pfx, suffix_len);
remaining = cnt;
diff --git a/coreutils/stty.c b/coreutils/stty.c
index d1309f9..40e8127 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -1320,7 +1320,7 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
break;
case 'F':
if (file_name)
- bb_error_msg_and_die("only one device may be specified");
+ bb_simple_error_msg_and_die("only one device may be specified");
file_name = &arg[i+1]; /* "-Fdevice" ? */
if (!file_name[0]) { /* nope, "-F device" */
int p = k+1; /* argv[p] is argnext */
@@ -1405,13 +1405,13 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
if ((stty_state & (STTY_verbose_output | STTY_recoverable_output)) ==
(STTY_verbose_output | STTY_recoverable_output)
) {
- bb_error_msg_and_die("-a and -g are mutually exclusive");
+ bb_simple_error_msg_and_die("-a and -g are mutually exclusive");
}
/* Specifying -a or -g with non-options is an error */
if ((stty_state & (STTY_verbose_output | STTY_recoverable_output))
&& !(stty_state & STTY_noargs)
) {
- bb_error_msg_and_die("modes may not be set when -a or -g is used");
+ bb_simple_error_msg_and_die("modes may not be set when -a or -g is used");
}
/* Now it is safe to start doing things */
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 14ed85d..1f458f9 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -89,7 +89,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
r = full_read(fd, buf, count);
if (r < 0) {
- bb_perror_msg(bb_msg_read_error);
+ bb_simple_perror_msg(bb_msg_read_error);
G.exitcode = EXIT_FAILURE;
}
@@ -186,7 +186,7 @@ int tail_main(int argc, char **argv)
} while (++i < argc);
if (!nfiles)
- bb_error_msg_and_die("no files");
+ bb_simple_error_msg_and_die("no files");
/* prepare the buffer */
tailbufsize = BUFSIZ;
diff --git a/coreutils/test.c b/coreutils/test.c
index 8d7dac0..868ffbe 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -832,12 +832,12 @@ int test_main(int argc, char **argv)
--argc;
if (!arg0[1]) { /* "[" ? */
if (NOT_LONE_CHAR(argv[argc], ']')) {
- bb_error_msg("missing ]");
+ bb_simple_error_msg("missing ]");
return 2;
}
} else { /* assuming "[[" */
if (strcmp(argv[argc], "]]") != 0) {
- bb_error_msg("missing ]]");
+ bb_simple_error_msg("missing ]]");
return 2;
}
}
diff --git a/coreutils/tr.c b/coreutils/tr.c
index ae35a9e..1e402df 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -308,7 +308,7 @@ int tr_main(int argc UNUSED_PARAM, char **argv)
str1_length = complement(str1, str1_length);
if (*argv) {
if (argv[0][0] == '\0')
- bb_error_msg_and_die("STRING2 cannot be empty");
+ bb_simple_error_msg_and_die("STRING2 cannot be empty");
str2_length = expand(*argv, &str2);
map(vector, str1, str1_length,
str2, str2_length);
@@ -333,7 +333,7 @@ int tr_main(int argc UNUSED_PARAM, char **argv)
read_chars = safe_read(STDIN_FILENO, str1, TR_BUFSIZ);
if (read_chars <= 0) {
if (read_chars < 0)
- bb_perror_msg_and_die(bb_msg_read_error);
+ bb_simple_perror_msg_and_die(bb_msg_read_error);
break;
}
in_index = 0;
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 5f69e62..dc8ef5c 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -82,7 +82,7 @@ static void FAST_FUNC read_stduu(FILE *src_stream, FILE *dst_stream, int flags U
continue;
}
if (encoded_len > 60) {
- bb_error_msg_and_die("line too long");
+ bb_simple_error_msg_and_die("line too long");
}
dst = line;
@@ -108,7 +108,7 @@ static void FAST_FUNC read_stduu(FILE *src_stream, FILE *dst_stream, int flags U
fwrite(line, 1, dst - line, dst_stream);
free(line);
}
- bb_error_msg_and_die("short file");
+ bb_simple_error_msg_and_die("short file");
}
#endif
@@ -166,7 +166,7 @@ int uudecode_main(int argc UNUSED_PARAM, char **argv)
/* fclose_if_not_stdin(src_stream); - redundant */
return EXIT_SUCCESS;
}
- bb_error_msg_and_die("no 'begin' line");
+ bb_simple_error_msg_and_die("no 'begin' line");
}
#endif
@@ -216,7 +216,7 @@ int base64_main(int argc UNUSED_PARAM, char **argv)
if (!size)
break;
if ((ssize_t)size < 0)
- bb_perror_msg_and_die(bb_msg_read_error);
+ bb_simple_perror_msg_and_die(bb_msg_read_error);
/* Encode the buffer we just read in */
bb_uuencode(dst_buf, src_buf, size, bb_uuenc_tbl_base64);
xwrite(STDOUT_FILENO, dst_buf, 4 * ((size + 2) / 3));
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 2807ef8..db49ec8 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -66,7 +66,7 @@ int uuencode_main(int argc UNUSED_PARAM, char **argv)
if (!size)
break;
if ((ssize_t)size < 0)
- bb_perror_msg_and_die(bb_msg_read_error);
+ bb_simple_perror_msg_and_die(bb_msg_read_error);
/* Encode the buffer we just read in */
bb_uuencode(dst_buf, src_buf, size, tbl);
bb_putchar('\n');