diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-04 17:16:44 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-04 17:16:44 +0200 |
commit | 7e1bb4bc5c1e2724a00bb4ef18925c8ed6f44886 (patch) | |
tree | bee78ed7ec0f371025dfd5dcdf9de21f14029c60 | |
parent | 926031b7640bf5aad2ffcd54b096911743a47d97 (diff) | |
download | busybox-w32-7e1bb4bc5c1e2724a00bb4ef18925c8ed6f44886.tar.gz busybox-w32-7e1bb4bc5c1e2724a00bb4ef18925c8ed6f44886.tar.bz2 busybox-w32-7e1bb4bc5c1e2724a00bb4ef18925c8ed6f44886.zip |
libbb: reduce number of *error_msg[_and_die].c files by four
No code changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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 cb1f8e954..5c567000a 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src | |||
@@ -32,8 +32,6 @@ lib-y += create_icmp_socket.o | |||
32 | lib-y += default_error_retval.o | 32 | lib-y += default_error_retval.o |
33 | lib-y += device_open.o | 33 | lib-y += device_open.o |
34 | lib-y += dump.o | 34 | lib-y += dump.o |
35 | lib-y += error_msg.o | ||
36 | lib-y += error_msg_and_die.o | ||
37 | lib-y += execable.o | 35 | lib-y += execable.o |
38 | lib-y += fclose_nonstdin.o | 36 | lib-y += fclose_nonstdin.o |
39 | lib-y += fflush_stdout_and_exit.o | 37 | lib-y += fflush_stdout_and_exit.o |
@@ -48,7 +46,6 @@ lib-y += getopt32.o | |||
48 | lib-y += getpty.o | 46 | lib-y += getpty.o |
49 | lib-y += get_volsize.o | 47 | lib-y += get_volsize.o |
50 | lib-y += herror_msg.o | 48 | lib-y += herror_msg.o |
51 | lib-y += herror_msg_and_die.o | ||
52 | lib-y += human_readable.o | 49 | lib-y += human_readable.o |
53 | lib-y += inet_common.o | 50 | lib-y += inet_common.o |
54 | lib-y += info_msg.o | 51 | lib-y += info_msg.o |
@@ -72,7 +69,6 @@ lib-y += obscure.o | |||
72 | lib-y += parse_mode.o | 69 | lib-y += parse_mode.o |
73 | lib-y += parse_config.o | 70 | lib-y += parse_config.o |
74 | lib-y += perror_msg.o | 71 | lib-y += perror_msg.o |
75 | lib-y += perror_msg_and_die.o | ||
76 | lib-y += perror_nomsg.o | 72 | lib-y += perror_nomsg.o |
77 | lib-y += perror_nomsg_and_die.o | 73 | lib-y += perror_nomsg_and_die.o |
78 | lib-y += pidfile.o | 74 | lib-y += pidfile.o |
diff --git a/libbb/error_msg.c b/libbb/error_msg.c deleted file mode 100644 index 802fd5715..000000000 --- a/libbb/error_msg.c +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
8 | */ | ||
9 | |||
10 | #include "libbb.h" | ||
11 | |||
12 | void FAST_FUNC bb_error_msg(const char *s, ...) | ||
13 | { | ||
14 | va_list p; | ||
15 | |||
16 | va_start(p, s); | ||
17 | bb_verror_msg(s, p, NULL); | ||
18 | va_end(p); | ||
19 | } | ||
diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c deleted file mode 100644 index 243433b2d..000000000 --- a/libbb/error_msg_and_die.c +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
8 | */ | ||
9 | |||
10 | #include "libbb.h" | ||
11 | |||
12 | void FAST_FUNC bb_error_msg_and_die(const char *s, ...) | ||
13 | { | ||
14 | va_list p; | ||
15 | |||
16 | va_start(p, s); | ||
17 | bb_verror_msg(s, p, NULL); | ||
18 | va_end(p); | ||
19 | xfunc_die(); | ||
20 | } | ||
diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c index 7e4f64045..ca9274cf7 100644 --- a/libbb/herror_msg.c +++ b/libbb/herror_msg.c | |||
@@ -6,7 +6,6 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | |||
10 | #include "libbb.h" | 9 | #include "libbb.h" |
11 | 10 | ||
12 | void FAST_FUNC bb_herror_msg(const char *s, ...) | 11 | void FAST_FUNC bb_herror_msg(const char *s, ...) |
@@ -17,3 +16,13 @@ void FAST_FUNC bb_herror_msg(const char *s, ...) | |||
17 | bb_verror_msg(s, p, hstrerror(h_errno)); | 16 | bb_verror_msg(s, p, hstrerror(h_errno)); |
18 | va_end(p); | 17 | va_end(p); |
19 | } | 18 | } |
19 | |||
20 | void FAST_FUNC bb_herror_msg_and_die(const char *s, ...) | ||
21 | { | ||
22 | va_list p; | ||
23 | |||
24 | va_start(p, s); | ||
25 | bb_verror_msg(s, p, hstrerror(h_errno)); | ||
26 | va_end(p); | ||
27 | xfunc_die(); | ||
28 | } | ||
diff --git a/libbb/herror_msg_and_die.c b/libbb/herror_msg_and_die.c deleted file mode 100644 index 230fe645a..000000000 --- a/libbb/herror_msg_and_die.c +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
8 | */ | ||
9 | |||
10 | #include "libbb.h" | ||
11 | |||
12 | void FAST_FUNC bb_herror_msg_and_die(const char *s, ...) | ||
13 | { | ||
14 | va_list p; | ||
15 | |||
16 | va_start(p, s); | ||
17 | bb_verror_msg(s, p, hstrerror(h_errno)); | ||
18 | va_end(p); | ||
19 | xfunc_die(); | ||
20 | } | ||
diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c index 6c8e1b51e..cbba805fb 100644 --- a/libbb/perror_msg.c +++ b/libbb/perror_msg.c | |||
@@ -6,7 +6,6 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | |||
10 | #include "libbb.h" | 9 | #include "libbb.h" |
11 | 10 | ||
12 | void FAST_FUNC bb_perror_msg(const char *s, ...) | 11 | void FAST_FUNC bb_perror_msg(const char *s, ...) |
@@ -19,7 +18,23 @@ void FAST_FUNC bb_perror_msg(const char *s, ...) | |||
19 | va_end(p); | 18 | va_end(p); |
20 | } | 19 | } |
21 | 20 | ||
21 | void FAST_FUNC bb_perror_msg_and_die(const char *s, ...) | ||
22 | { | ||
23 | va_list p; | ||
24 | |||
25 | va_start(p, s); | ||
26 | /* Guard against "<error message>: Success" */ | ||
27 | bb_verror_msg(s, p, errno ? strerror(errno) : NULL); | ||
28 | va_end(p); | ||
29 | xfunc_die(); | ||
30 | } | ||
31 | |||
22 | void FAST_FUNC bb_simple_perror_msg(const char *s) | 32 | void FAST_FUNC bb_simple_perror_msg(const char *s) |
23 | { | 33 | { |
24 | bb_perror_msg("%s", s); | 34 | bb_perror_msg("%s", s); |
25 | } | 35 | } |
36 | |||
37 | void FAST_FUNC bb_simple_perror_msg_and_die(const char *s) | ||
38 | { | ||
39 | bb_perror_msg_and_die("%s", s); | ||
40 | } | ||
diff --git a/libbb/perror_msg_and_die.c b/libbb/perror_msg_and_die.c deleted file mode 100644 index 15615fa22..000000000 --- a/libbb/perror_msg_and_die.c +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
8 | */ | ||
9 | |||
10 | #include "libbb.h" | ||
11 | |||
12 | void FAST_FUNC bb_perror_msg_and_die(const char *s, ...) | ||
13 | { | ||
14 | va_list p; | ||
15 | |||
16 | va_start(p, s); | ||
17 | /* Guard against "<error message>: Success" */ | ||
18 | bb_verror_msg(s, p, errno ? strerror(errno) : NULL); | ||
19 | va_end(p); | ||
20 | xfunc_die(); | ||
21 | } | ||
22 | |||
23 | void FAST_FUNC bb_simple_perror_msg_and_die(const char *s) | ||
24 | { | ||
25 | bb_perror_msg_and_die("%s", s); | ||
26 | } | ||
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c index 613432906..c5fbc380c 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) | |||
76 | free(msg); | 76 | free(msg); |
77 | } | 77 | } |
78 | 78 | ||
79 | |||
80 | #ifdef VERSION_WITH_WRITEV | 79 | #ifdef VERSION_WITH_WRITEV |
81 | |||
82 | /* Code size is approximately the same, but currently it's the only user | 80 | /* Code size is approximately the same, but currently it's the only user |
83 | * of writev in entire bbox. __libc_writev in uclibc is ~50 bytes. */ | 81 | * of writev in entire bbox. __libc_writev in uclibc is ~50 bytes. */ |
84 | |||
85 | void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) | 82 | void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) |
86 | { | 83 | { |
87 | int strerr_len, msgeol_len; | 84 | int strerr_len, msgeol_len; |
@@ -139,3 +136,23 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr) | |||
139 | free(msgc); | 136 | free(msgc); |
140 | } | 137 | } |
141 | #endif | 138 | #endif |
139 | |||
140 | |||
141 | void FAST_FUNC bb_error_msg_and_die(const char *s, ...) | ||
142 | { | ||
143 | va_list p; | ||
144 | |||
145 | va_start(p, s); | ||
146 | bb_verror_msg(s, p, NULL); | ||
147 | va_end(p); | ||
148 | xfunc_die(); | ||
149 | } | ||
150 | |||
151 | void FAST_FUNC bb_error_msg(const char *s, ...) | ||
152 | { | ||
153 | va_list p; | ||
154 | |||
155 | va_start(p, s); | ||
156 | bb_verror_msg(s, p, NULL); | ||
157 | va_end(p); | ||
158 | } | ||