I've tried to remove "common patterns" in the code. Second try: I've changed bb_\(p?\)error_msg\(_and_die\)("%s", \(.*\)) in bb_simple_\1error_msg\2(\3).
Patch attached. Loïc
Index: networking/libiproute/iproute.c =================================================================== --- networking/libiproute/iproute.c (révision 20138) +++ networking/libiproute/iproute.c (copie de travail) @@ -13,6 +13,7 @@ * Kunihiro Ishiguro <[EMAIL PROTECTED]> 001102: rtnh_ifindex was not initialized */ +#define __IN_IPROUTE__ #include "ip_common.h" /* #include "libbb.h" is inside */ #include "rt_names.h" #include "utils.h" Index: networking/inetd.c =================================================================== --- networking/inetd.c (révision 20138) +++ networking/inetd.c (copie de travail) @@ -983,7 +983,7 @@ 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) Index: networking/netstat.c =================================================================== --- networking/netstat.c (révision 20138) +++ networking/netstat.c (copie de travail) @@ -464,7 +464,7 @@ 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); } Index: networking/httpd.c =================================================================== --- networking/httpd.c (révision 20138) +++ networking/httpd.c (copie de travail) @@ -504,7 +504,7 @@ 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; } Index: archival/bbunzip.c =================================================================== --- archival/bbunzip.c (révision 20138) +++ archival/bbunzip.c (copie de travail) @@ -49,7 +49,7 @@ /* 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; Index: modutils/rmmod.c =================================================================== --- modutils/rmmod.c (révision 20138) +++ modutils/rmmod.c (copie de travail) @@ -85,7 +85,7 @@ } 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; } } Index: shell/lash.c =================================================================== --- shell/lash.c (révision 20138) +++ shell/lash.c (copie de travail) @@ -1159,7 +1159,7 @@ /* 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); } Index: coreutils/wc.c =================================================================== --- coreutils/wc.c (révision 20138) +++ coreutils/wc.c (copie de travail) @@ -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]; Index: coreutils/nice.c =================================================================== --- coreutils/nice.c (révision 20138) +++ coreutils/nice.c (copie de travail) @@ -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); } Index: coreutils/dd.c =================================================================== --- coreutils/dd.c (révision 20138) +++ coreutils/dd.c (copie de travail) @@ -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); Index: coreutils/df.c =================================================================== --- coreutils/df.c (révision 20138) +++ coreutils/df.c (copie de travail) @@ -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; } Index: coreutils/split.c =================================================================== --- coreutils/split.c (révision 20138) +++ coreutils/split.c (copie de travail) @@ -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) { Index: coreutils/mknod.c =================================================================== --- coreutils/mknod.c (révision 20138) +++ coreutils/mknod.c (copie de travail) @@ -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(); Index: coreutils/ln.c =================================================================== --- coreutils/ln.c (révision 20138) +++ coreutils/ln.c (copie de travail) @@ -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; } Index: coreutils/mkfifo.c =================================================================== --- coreutils/mkfifo.c (révision 20138) +++ coreutils/mkfifo.c (copie de travail) @@ -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); Index: coreutils/fold.c =================================================================== --- coreutils/fold.c (révision 20138) +++ coreutils/fold.c (copie de travail) @@ -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); Index: coreutils/nohup.c =================================================================== --- coreutils/nohup.c (révision 20138) +++ coreutils/nohup.c (copie de travail) @@ -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]); } Index: coreutils/chmod.c =================================================================== --- coreutils/chmod.c (révision 20138) +++ coreutils/chmod.c (copie de travail) @@ -63,7 +63,7 @@ } err: if (!OPT_QUIET) - bb_perror_msg("%s", fileName); + bb_simple_perror_msg(fileName); return FALSE; } Index: coreutils/realpath.c =================================================================== --- coreutils/realpath.c (révision 20138) +++ coreutils/realpath.c (copie de travail) @@ -35,7 +35,7 @@ puts(resolved_path); } else { retval = EXIT_FAILURE; - bb_perror_msg("%s", *argv); + bb_simple_perror_msg(*argv); } } while (--argc); Index: coreutils/head.c =================================================================== --- coreutils/head.c (révision 20138) +++ coreutils/head.c (copie de travail) @@ -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(); Index: coreutils/chown.c =================================================================== --- coreutils/chown.c (révision 20138) +++ coreutils/chown.c (copie de travail) @@ -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; } Index: coreutils/env.c =================================================================== --- coreutils/env.c (révision 20138) +++ coreutils/env.c (copie de travail) @@ -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++) { Index: coreutils/du.c =================================================================== --- coreutils/du.c (révision 20138) +++ coreutils/du.c (copie de travail) @@ -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; } Index: coreutils/ls.c =================================================================== --- coreutils/ls.c (révision 20138) +++ coreutils/ls.c (copie de travail) @@ -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; } Index: coreutils/expand.c =================================================================== --- coreutils/expand.c (révision 20138) +++ coreutils/expand.c (copie de travail) @@ -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 */ Index: coreutils/touch.c =================================================================== --- coreutils/touch.c (révision 20138) +++ coreutils/touch.c (copie de travail) @@ -49,7 +49,7 @@ } } status = EXIT_FAILURE; - bb_perror_msg("%s", *argv); + bb_simple_perror_msg(*argv); } } while (*++argv); Index: libbb/vfork_daemon_rexec.c =================================================================== --- libbb/vfork_daemon_rexec.c (révision 20138) +++ libbb/vfork_daemon_rexec.c (copie de travail) @@ -62,7 +62,7 @@ { pid_t pid = spawn(argv); if (pid < 0) - bb_perror_msg_and_die("%s", *argv); + bb_simple_perror_msg_and_die(*argv); return pid; } Index: libbb/recursive_action.c =================================================================== --- libbb/recursive_action.c (révision 20138) +++ libbb/recursive_action.c (copie de travail) @@ -120,6 +120,6 @@ return TRUE; done_nak_warn: - bb_perror_msg("%s", fileName); + bb_simple_perror_msg(fileName); return FALSE; } Index: libbb/perror_msg_and_die.c =================================================================== --- libbb/perror_msg_and_die.c (révision 20138) +++ libbb/perror_msg_and_die.c (copie de travail) @@ -19,3 +19,9 @@ va_end(p); xfunc_die(); } + +void bb_simple_perror_msg_and_die(const char *s) +{ + bb_simple_perror_msg(s); + xfunc_die(); +} Index: libbb/verror_msg.c =================================================================== --- libbb/verror_msg.c (révision 20138) +++ libbb/verror_msg.c (copie de travail) @@ -10,17 +10,11 @@ #include <syslog.h> #include "libbb.h" -smallint logmode = LOGMODE_STDIO; -const char *msg_eol = "\n"; - void bb_verror_msg(const char *s, va_list p, const char* strerr) { char *msg; - int applet_len, strerr_len, msgeol_len, used; + int used; - if (!logmode) - return; - if (!s) /* nomsg[_and_die] uses NULL fmt */ s = ""; /* some libc don't like printf(NULL) */ @@ -28,98 +22,6 @@ if (used < 0) return; - /* This is ugly and costs +60 bytes compared to multiple - * fprintf's, but is guaranteed to do a single write. - * This is needed for e.g. httpd logging, when multiple - * children can produce log messages simultaneously. */ - - applet_len = strlen(applet_name) + 2; /* "applet: " */ - strerr_len = strerr ? strlen(strerr) : 0; - msgeol_len = strlen(msg_eol); - /* +3 is for ": " before strerr and for terminating NUL */ - msg = xrealloc(msg, applet_len + used + strerr_len + msgeol_len + 3); - /* TODO: maybe use writev instead of memmoving? Need full_writev? */ - memmove(msg + applet_len, msg, used); - used += applet_len; - strcpy(msg, applet_name); - msg[applet_len - 2] = ':'; - msg[applet_len - 1] = ' '; - if (strerr) { - msg[used++] = ':'; - msg[used++] = ' '; - strcpy(&msg[used], strerr); - used += strerr_len; - } - strcpy(&msg[used], msg_eol); - - if (logmode & LOGMODE_STDIO) { - fflush(stdout); - full_write(2, msg, used + msgeol_len); - } - if (logmode & LOGMODE_SYSLOG) { - syslog(LOG_ERR, "%s", msg + applet_len); - } + bb_simple_error_msg_length(msg, used, strerr); free(msg); } - - -#ifdef VERSION_WITH_WRITEV - -/* Code size is approximately the same, but currently it's the only user - * of writev in entire bbox. __libc_writev in uclibc is ~50 bytes. */ - -void bb_verror_msg(const char *s, va_list p, const char* strerr) -{ - int strerr_len, msgeol_len; - struct iovec iov[3]; - -#define used (iov[2].iov_len) -#define msgv (iov[2].iov_base) -#define msgc ((char*)(iov[2].iov_base)) -#define msgptr (&(iov[2].iov_base)) - - if (!logmode) - return; - - if (!s) /* nomsg[_and_die] uses NULL fmt */ - s = ""; /* some libc don't like printf(NULL) */ - - /* Prevent "derefing type-punned ptr will break aliasing rules" */ - used = vasprintf((char**)(void*)msgptr, s, p); - if (used < 0) - return; - - /* This is ugly and costs +60 bytes compared to multiple - * fprintf's, but is guaranteed to do a single write. - * This is needed for e.g. httpd logging, when multiple - * children can produce log messages simultaneously. */ - - strerr_len = strerr ? strlen(strerr) : 0; - msgeol_len = strlen(msg_eol); - /* +3 is for ": " before strerr and for terminating NUL */ - msgv = xrealloc(msgv, used + strerr_len + msgeol_len + 3); - if (strerr) { - msgc[used++] = ':'; - msgc[used++] = ' '; - strcpy(msgc + used, strerr); - used += strerr_len; - } - strcpy(msgc + used, msg_eol); - used += msgeol_len; - - if (logmode & LOGMODE_STDIO) { - iov[0].iov_base = (char*)applet_name; - iov[0].iov_len = strlen(applet_name); - iov[1].iov_base = (char*)": "; - iov[1].iov_len = 2; - /*iov[2].iov_base = msgc;*/ - /*iov[2].iov_len = used;*/ - fflush(stdout); - writev(2, iov, 3); - } - if (logmode & LOGMODE_SYSLOG) { - syslog(LOG_ERR, "%s", msgc); - } - free(msgc); -} -#endif Index: libbb/wfopen.c =================================================================== --- libbb/wfopen.c (révision 20138) +++ libbb/wfopen.c (copie de travail) @@ -13,7 +13,7 @@ { FILE *fp = fopen(path, mode); if (!fp) { - bb_perror_msg("%s", path); + bb_simple_perror_msg(path); errno = 0; } return fp; Index: libbb/Kbuild =================================================================== --- libbb/Kbuild (révision 20138) +++ libbb/Kbuild (copie de travail) @@ -76,6 +76,7 @@ lib-y += safe_write.o lib-y += setup_environment.o lib-y += sha1.o +lib-y += simple_error_msg.o lib-y += simplify_path.o lib-y += skip_whitespace.o lib-y += speed_table.o Index: libbb/change_identity.c =================================================================== --- libbb/change_identity.c (révision 20138) +++ libbb/change_identity.c (copie de travail) @@ -47,5 +47,5 @@ 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); } Index: libbb/dump.c =================================================================== --- libbb/dump.c (révision 20138) +++ libbb/dump.c (copie de travail) @@ -297,7 +297,7 @@ 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) || @@ -309,7 +309,7 @@ } } 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; @@ -328,7 +328,7 @@ for (;;) { if (*_argv) { if (!(freopen(*_argv, "r", stdin))) { - bb_perror_msg("%s", *_argv); + bb_simple_perror_msg(*_argv); exitval = 1; ++_argv; continue; @@ -393,7 +393,7 @@ 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; Index: libbb/xfuncs.c =================================================================== --- libbb/xfuncs.c (révision 20138) +++ libbb/xfuncs.c (copie de travail) @@ -699,13 +699,13 @@ 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) Index: libbb/perror_msg.c =================================================================== --- libbb/perror_msg.c (révision 20138) +++ libbb/perror_msg.c (copie de travail) @@ -18,3 +18,8 @@ bb_verror_msg(s, p, errno ? strerror(errno) : NULL); va_end(p); } + +void bb_simple_perror_msg(const char *s) +{ + bb_simple_error_msg(s, errno ? strerror(errno) : NULL); +} Index: e2fsprogs/fsck.c =================================================================== --- e2fsprogs/fsck.c (révision 20138) +++ e2fsprogs/fsck.c (copie de travail) @@ -659,7 +659,7 @@ 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++) Index: e2fsprogs/old_e2fsprogs/fsck.c =================================================================== --- e2fsprogs/old_e2fsprogs/fsck.c (révision 20138) +++ e2fsprogs/old_e2fsprogs/fsck.c (copie de travail) @@ -626,7 +626,7 @@ 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++) Index: miscutils/chrt.c =================================================================== --- miscutils/chrt.c (révision 20138) +++ miscutils/chrt.c (copie de travail) @@ -115,7 +115,7 @@ } ++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 Index: miscutils/mountpoint.c =================================================================== --- miscutils/mountpoint.c (révision 20138) +++ miscutils/mountpoint.c (copie de travail) @@ -61,6 +61,6 @@ } } if (!(opt & OPT_q)) - bb_perror_msg("%s", arg); + bb_simple_perror_msg(arg); return EXIT_FAILURE; } Index: miscutils/taskset.c =================================================================== --- miscutils/taskset.c (révision 20138) +++ miscutils/taskset.c (copie de travail) @@ -92,7 +92,7 @@ } ++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 Index: miscutils/setsid.c =================================================================== --- miscutils/setsid.c (révision 20138) +++ miscutils/setsid.c (copie de travail) @@ -29,5 +29,5 @@ 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]); } Index: include/libbb.h =================================================================== --- include/libbb.h (révision 20138) +++ include/libbb.h (copie de travail) @@ -676,7 +676,11 @@ 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))); +#ifndef __IN_IPROUTE__ +extern void bb_simple_perror_msg(const char *s); +#endif 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; @@ -1184,7 +1188,6 @@ #include <dmalloc.h> #endif - #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif /* __LIBBUSYBOX_H__ */ Index: selinux/setfiles.c =================================================================== --- selinux/setfiles.c (révision 20138) +++ selinux/setfiles.c (copie de travail) @@ -595,7 +595,7 @@ 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]); @@ -603,7 +603,7 @@ /* 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++; Index: loginutils/adduser.c =================================================================== --- loginutils/adduser.c (révision 20138) +++ loginutils/adduser.c (copie de travail) @@ -144,7 +144,7 @@ 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); } } Index: findutils/find.c =================================================================== --- findutils/find.c (révision 20138) +++ findutils/find.c (copie de travail) @@ -277,7 +277,7 @@ 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]) @@ -347,7 +347,7 @@ rc = unlink(fileName); } if (rc < 0) - bb_perror_msg("%s", fileName); + bb_simple_perror_msg(fileName); return TRUE; } #endif @@ -780,7 +780,7 @@ 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 { Index: findutils/xargs.c =================================================================== --- findutils/xargs.c (révision 20138) +++ findutils/xargs.c (copie de travail) @@ -57,7 +57,7 @@ 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) { Index: findutils/grep.c =================================================================== --- findutils/grep.c (révision 20138) +++ findutils/grep.c (copie de travail) @@ -369,7 +369,7 @@ 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; } @@ -517,7 +517,7 @@ 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; } Index: init/mesg.c =================================================================== --- init/mesg.c (révision 20138) +++ init/mesg.c (copie de travail) @@ -40,7 +40,7 @@ return EXIT_SUCCESS; } } - bb_perror_msg_and_die("%s", tty); + bb_simple_perror_msg_and_die(tty); } bb_show_usage(); } Index: applets/applets.c =================================================================== --- applets/applets.c (révision 20138) +++ applets/applets.c (copie de travail) @@ -526,7 +526,7 @@ applets[i].name); rc = lf(busybox, fpc); if (rc != 0 && errno != EEXIST) { - bb_perror_msg("%s", fpc); + bb_simple_perror_msg(fpc); } free(fpc); } Index: util-linux/swaponoff.c =================================================================== --- util-linux/swaponoff.c (révision 20138) +++ util-linux/swaponoff.c (copie de travail) @@ -31,7 +31,7 @@ status = swapoff(device); if (status != 0) { - bb_perror_msg("%s", device); + bb_simple_perror_msg(device); return 1; } Index: util-linux/setarch.c =================================================================== --- util-linux/setarch.c (révision 20138) +++ util-linux/setarch.c (copie de travail) @@ -44,5 +44,5 @@ BB_EXECVP(argv[0], argv); } - bb_perror_msg_and_die("%s", argv[0]); + bb_simple_perror_msg_and_die(argv[0]); } Index: util-linux/mount.c =================================================================== --- util-linux/mount.c (révision 20138) +++ util-linux/mount.c (copie de travail) @@ -1655,7 +1655,7 @@ && (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; }
_______________________________________________ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox