263 bytes saved.
applets[i].name);
rc = lf(busybox, fpc);
if (rc != 0 && errno != EEXIST) {
- bb_perror_msg("%s", fpc);
+ bb_simple_perror_msg(fpc);
}
free(fpc);
}
/* Open src */
if (filename) {
if (stat(filename, &stat_buf) != 0) {
- bb_perror_msg("%s", filename);
+ bb_simple_perror_msg(filename);
err:
exitcode = 1;
goto free_name;
}
err:
if (!OPT_QUIET)
- bb_perror_msg("%s", fileName);
+ bb_simple_perror_msg(fileName);
return FALSE;
}
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;
}
if (n < 0) {
if (flags & FLAG_NOERROR) {
n = ibs;
- bb_perror_msg("%s", infile);
+ bb_simple_perror_msg(infile);
} else
goto die_infile;
}
}
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);
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;
}
unsigned long sum;
if (lstat(filename, &statbuf) != 0) {
- bb_perror_msg("%s", filename);
+ bb_simple_perror_msg(filename);
G.status = EXIT_FAILURE;
return 0;
}
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;
}
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++) {
/* 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 */
}
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);
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();
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;
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;
}
if (link_func(*argv, src) != 0) {
- bb_perror_msg("%s", src);
+ bb_simple_perror_msg(src);
status = EXIT_FAILURE;
}
}
#endif
if (stat(fullname, &dstat)) {
- bb_perror_msg("%s", fullname);
+ bb_simple_perror_msg(fullname);
status = EXIT_FAILURE;
return 0;
}
}
#endif
if (lstat(fullname, &dstat)) {
- bb_perror_msg("%s", fullname);
+ bb_simple_perror_msg(fullname);
status = EXIT_FAILURE;
return 0;
}
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);
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();
/* 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);
}
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]);
}
puts(resolved_path);
} else {
retval = EXIT_FAILURE;
- bb_perror_msg("%s", *argv);
+ bb_simple_perror_msg(*argv);
}
} while (--argc);
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) {
}
}
status = EXIT_FAILURE;
- bb_perror_msg("%s", *argv);
+ bb_simple_perror_msg(*argv);
}
} while (*++argv);
}
} else if (c == EOF) {
if (ferror(fp)) {
- bb_perror_msg("%s", arg);
+ bb_simple_perror_msg(arg);
status = EXIT_FAILURE;
}
--counts[WC_CHARS];
if (!noexecute) {
pid = spawn(argv);
if (pid < 0)
- bb_perror_msg("%s", argv[0]);
+ bb_simple_perror_msg(argv[0]);
}
for (i = num_args+1; i < argc; i++)
if (!interactive)
close(0);
(void) execv(s, argv);
- bb_perror_msg_and_die("%s", argv[0]);
+ bb_simple_perror_msg_and_die(argv[0]);
}
for (i = 1; i < argc; i++)
rc = spawn_and_wait(argv);
if (rc < 0)
- bb_perror_msg("%s", argv[0]);
+ bb_simple_perror_msg(argv[0]);
i = 0;
while (argv[i])
rc = unlink(fileName);
}
if (rc < 0)
- bb_perror_msg("%s", fileName);
+ bb_simple_perror_msg(fileName);
return TRUE;
}
#endif
ap->context = NULL;
/* SELinux headers erroneously declare non-const parameter */
if (selinux_raw_to_trans_context((char*)arg1, &ap->context))
- bb_perror_msg("%s", arg1);
+ bb_simple_perror_msg(arg1);
}
#endif
else {
FILE *file = fopen(filename, "r");
if (file == NULL) {
if (!SUPPRESS_ERR_MSGS)
- bb_perror_msg("%s", cur_file);
+ bb_simple_perror_msg(cur_file);
open_errors = 1;
return 0;
}
file = fopen(cur_file, "r");
if (file == NULL) {
if (!SUPPRESS_ERR_MSGS)
- bb_perror_msg("%s", cur_file);
+ bb_simple_perror_msg(cur_file);
open_errors = 1;
continue;
}
status = spawn_and_wait(args);
if (status < 0) {
- bb_perror_msg("%s", args[0]);
+ bb_simple_perror_msg(args[0]);
return errno == ENOENT ? 127 : 126;
}
if (status == 255) {
extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
+extern void bb_simple_perror_msg(const char *s);
extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
+extern void bb_simple_perror_msg_and_die(const char *s) __attribute__ ((noreturn));
extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN;
#include <dmalloc.h>
#endif
-
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif /* __LIBBUSYBOX_H__ */
return EXIT_SUCCESS;
}
}
- bb_perror_msg_and_die("%s", tty);
+ bb_simple_perror_msg_and_die(tty);
}
bb_show_usage();
}
const char *err_msg = change_identity_e2str(pw);
if (err_msg)
- bb_perror_msg_and_die("%s", err_msg);
+ bb_simple_perror_msg_and_die(err_msg);
}
if (statok) {
if (fstat(STDIN_FILENO, &sbuf)) {
- bb_perror_msg_and_die("%s", fname);
+ bb_simple_perror_msg_and_die(fname);
}
if ((!(S_ISCHR(sbuf.st_mode) ||
S_ISBLK(sbuf.st_mode) ||
}
}
if (fseek(stdin, bb_dump_skip, SEEK_SET)) {
- bb_perror_msg_and_die("%s", fname);
+ bb_simple_perror_msg_and_die(fname);
}
savaddress = address += bb_dump_skip;
bb_dump_skip = 0;
for (;;) {
if (*_argv) {
if (!(freopen(*_argv, "r", stdin))) {
- bb_perror_msg("%s", *_argv);
+ bb_simple_perror_msg(*_argv);
exitval = 1;
++_argv;
continue;
bb_dump_length == -1 ? need : MIN(bb_dump_length, need), stdin);
if (!n) {
if (ferror(stdin)) {
- bb_perror_msg("%s", _argv[-1]);
+ bb_simple_perror_msg(_argv[-1]);
}
ateof = 1;
continue;
bb_verror_msg(s, p, errno ? strerror(errno) : NULL);
va_end(p);
}
+
+void bb_simple_perror_msg(const char *s)
+{
+ bb_perror_msg("%s", s);
+}
va_end(p);
xfunc_die();
}
+
+void bb_simple_perror_msg_and_die(const char *s)
+{
+ bb_perror_msg_and_die("%s", s);
+}
return TRUE;
done_nak_warn:
- bb_perror_msg("%s", fileName);
+ bb_simple_perror_msg(fileName);
return FALSE;
}
{
pid_t pid = spawn(argv);
if (pid < 0)
- bb_perror_msg_and_die("%s", *argv);
+ bb_simple_perror_msg_and_die(*argv);
return pid;
}
{
FILE *fp = fopen(path, mode);
if (!fp) {
- bb_perror_msg("%s", path);
+ bb_simple_perror_msg(path);
errno = 0;
}
return fp;
ret = ioctl(fd, request, argp);
if (ret < 0)
- bb_perror_msg("%s", ioctl_name);
+ bb_simple_perror_msg(ioctl_name);
return ret;
}
void bb_xioctl(int fd, int request, void *argp, const char *ioctl_name)
{
if (ioctl(fd, request, argp) < 0)
- bb_perror_msg_and_die("%s", ioctl_name);
+ bb_simple_perror_msg_and_die(ioctl_name);
}
#else
int bb_ioctl_or_warn(int fd, int request, void *argp)
if (mkdir(p->pw_dir, 0755)
|| chown(p->pw_dir, p->pw_uid, p->pw_gid)
|| chmod(p->pw_dir, 02755)) {
- bb_perror_msg("%s", p->pw_dir);
+ bb_simple_perror_msg(p->pw_dir);
}
}
}
++argv;
BB_EXECVP(*argv, argv);
- bb_perror_msg_and_die("%s", *argv);
+ bb_simple_perror_msg_and_die(*argv);
}
#undef OPT_p
#undef OPT_r
}
}
if (!(opt & OPT_q))
- bb_perror_msg("%s", arg);
+ bb_simple_perror_msg(arg);
return EXIT_FAILURE;
}
setsid(); /* no error possible */
BB_EXECVP(argv[1], argv + 1);
- bb_perror_msg_and_die("%s", argv[1]);
+ bb_simple_perror_msg_and_die(argv[1]);
}
}
++argv;
BB_EXECVP(*argv, argv);
- bb_perror_msg_and_die("%s", *argv);
+ bb_simple_perror_msg_and_die(*argv);
}
#undef OPT_p
#undef TASKSET_PRINTF_MASK
}
if (syscall(__NR_delete_module, ENABLE_FEATURE_2_6_MODULES ? misc_buf : argv[n], flags)) {
- bb_perror_msg("%s", argv[n]);
+ bb_simple_perror_msg(argv[n]);
ret = EXIT_FAILURE;
}
}
return;
}
if (configFile && flag == FIRST_PARSE) /* if -c option given */
- bb_perror_msg_and_die("%s", cf);
+ bb_simple_perror_msg_and_die(cf);
flag = FIND_FROM_HTTPD_ROOT;
cf = httpd_conf;
}
char protoname[10];
if (!setconfig()) {
- bb_perror_msg("%s", config_filename);
+ bb_simple_perror_msg(config_filename);
return;
}
for (sep = servtab; sep; sep = sep->se_next)
procinfo = fopen(file, "r");
if (procinfo == NULL) {
if (errno != ENOENT) {
- bb_perror_msg("%s", file);
+ bb_simple_perror_msg(file);
} else {
bb_error_msg("no support for '%s' on this system", name);
}
if (argc == 1)
bb_show_usage();
if (stat(argv[optind], &sb) < 0) {
- bb_perror_msg_and_die("%s", argv[optind]);
+ bb_simple_perror_msg_and_die(argv[optind]);
}
if (!S_ISREG(sb.st_mode)) {
bb_error_msg_and_die("spec file %s is not a regular file", argv[optind]);
/* Load the file contexts configuration and check it. */
rc = matchpathcon_init(argv[optind]);
if (rc < 0) {
- bb_perror_msg_and_die("%s", argv[optind]);
+ bb_simple_perror_msg_and_die(argv[optind]);
}
optind++;
/* Do not use bb_perror_msg_and_die() here, since we must not
* call exit() but should call _exit() instead */
- bb_perror_msg("%s", child->argv[0]);
+ bb_simple_perror_msg(child->argv[0]);
_exit(EXIT_FAILURE);
}
&& (i & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
) {
rc = mount("", argv[0], "", i, "");
- if (rc) bb_perror_msg_and_die("%s", argv[0]);
+ if (rc) bb_simple_perror_msg_and_die(argv[0]);
goto clean_up;
}
BB_EXECVP(argv[0], argv);
}
- bb_perror_msg_and_die("%s", argv[0]);
+ bb_simple_perror_msg_and_die(argv[0]);
}
status = swapoff(device);
if (status != 0) {
- bb_perror_msg("%s", device);
+ bb_simple_perror_msg(device);
return 1;
}