diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/Kbuild.src | 4 | ||||
-rw-r--r-- | libbb/error_msg.c | 19 | ||||
-rw-r--r-- | libbb/error_msg_and_die.c | 20 | ||||
-rw-r--r-- | libbb/herror_msg.c | 11 | ||||
-rw-r--r-- | libbb/herror_msg_and_die.c | 20 | ||||
-rw-r--r-- | libbb/perror_msg.c | 17 | ||||
-rw-r--r-- | libbb/perror_msg_and_die.c | 26 | ||||
-rw-r--r-- | libbb/verror_msg.c | 23 |
8 files changed, 46 insertions, 94 deletions
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index cb1f8e9..5c56700 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src @@ -32,8 +32,6 @@ lib-y += create_icmp_socket.o lib-y += default_error_retval.o lib-y += device_open.o lib-y += dump.o -lib-y += error_msg.o -lib-y += error_msg_and_die.o lib-y += execable.o lib-y += fclose_nonstdin.o lib-y += fflush_stdout_and_exit.o @@ -48,7 +46,6 @@ lib-y += getopt32.o lib-y += getpty.o lib-y += get_volsize.o lib-y += herror_msg.o -lib-y += herror_msg_and_die.o lib-y += human_readable.o lib-y += inet_common.o lib-y += info_msg.o @@ -72,7 +69,6 @@ lib-y += obscure.o lib-y += parse_mode.o lib-y += parse_config.o lib-y += perror_msg.o -lib-y += perror_msg_and_die.o lib-y += perror_nomsg.o lib-y += perror_nomsg_and_die.o lib-y += pidfile.o diff --git a/libbb/error_msg.c b/libbb/error_msg.c deleted file mode 100644 index 802fd57..0000000 --- a/libbb/error_msg.c +++ /dev/null @@ -1,19 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Utility routines. - * - * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> - * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. - */ - -#include "libbb.h" - -void FAST_FUNC bb_error_msg(const char *s, ...) -{ - va_list p; - - va_start(p, s); - bb_verror_msg(s, p, NULL); - va_end(p); -} diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c deleted file mode 100644 index 243433b..0000000 --- a/libbb/error_msg_and_die.c +++ /dev/null @@ -1,20 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Utility routines. - * - * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> - * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. - */ - -#include "libbb.h" - -void FAST_FUNC bb_error_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - bb_verror_msg(s, p, NULL); - va_end(p); - xfunc_die(); -} diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c index 7e4f640..ca9274c 100644 --- a/libbb/herror_msg.c +++ b/libbb/herror_msg.c @@ -6,7 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ - #include "libbb.h" void FAST_FUNC bb_herror_msg(const char *s, ...) @@ -17,3 +16,13 @@ void FAST_FUNC bb_herror_msg(const char *s, ...) bb_verror_msg(s, p, hstrerror(h_errno)); va_end(p); } + +void FAST_FUNC bb_herror_msg_and_die(const char *s, ...) +{ + va_list p; + + va_start(p, s); + bb_verror_msg(s, p, hstrerror(h_errno)); + va_end(p); + xfunc_die(); +} diff --git a/libbb/herror_msg_and_die.c b/libbb/herror_msg_and_die.c deleted file mode 100644 index 230fe64..0000000 --- a/libbb/herror_msg_and_die.c +++ /dev/null @@ -1,20 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Utility routines. - * - * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> - * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. - */ - -#include "libbb.h" - -void FAST_FUNC bb_herror_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - bb_verror_msg(s, p, hstrerror(h_errno)); - va_end(p); - xfunc_die(); -} diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c index 6c8e1b5..cbba805 100644 --- a/libbb/perror_msg.c +++ b/libbb/perror_msg.c @@ -6,7 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ - #include "libbb.h" void FAST_FUNC bb_perror_msg(const char *s, ...) @@ -19,7 +18,23 @@ void FAST_FUNC bb_perror_msg(const char *s, ...) va_end(p); } +void FAST_FUNC bb_perror_msg_and_die(const char *s, ...) +{ + va_list p; + + va_start(p, s); + /* Guard against "<error message>: Success" */ + bb_verror_msg(s, p, errno ? strerror(errno) : NULL); + va_end(p); + xfunc_die(); +} + void FAST_FUNC bb_simple_perror_msg(const char *s) { bb_perror_msg("%s", s); } + +void FAST_FUNC bb_simple_perror_msg_and_die(const char *s) +{ + bb_perror_msg_and_die("%s", s); +} diff --git a/libbb/perror_msg_and_die.c b/libbb/perror_msg_and_die.c deleted file mode 100644 index 15615fa..0000000 --- a/libbb/perror_msg_and_die.c +++ /dev/null @@ -1,26 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Utility routines. - * - * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> - * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. - */ - -#include "libbb.h" - -void FAST_FUNC bb_perror_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - /* Guard against "<error message>: Success" */ - bb_verror_msg(s, p, errno ? strerror(errno) : NULL); - va_end(p); - xfunc_die(); -} - -void FAST_FUNC bb_simple_perror_msg_and_die(const char *s) -{ - bb_perror_msg_and_die("%s", s); -} diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c index 6134329..c5fbc38 100644 --- a/libbb/verror_msg.c +++ b/libbb/verror_msg.c @@ -76,12 +76,9 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* 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 FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) { int strerr_len, msgeol_len; @@ -139,3 +136,23 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) free(msgc); } #endif + + +void FAST_FUNC bb_error_msg_and_die(const char *s, ...) +{ + va_list p; + + va_start(p, s); + bb_verror_msg(s, p, NULL); + va_end(p); + xfunc_die(); +} + +void FAST_FUNC bb_error_msg(const char *s, ...) +{ + va_list p; + + va_start(p, s); + bb_verror_msg(s, p, NULL); + va_end(p); +} |