diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-03-19 22:24:06 +0300 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-03-19 22:24:06 +0300 |
commit | b183dfad2daea713e712470d206b0f0287331083 (patch) | |
tree | 26a1f1080be5f9f44c72b45b72aae743d74685dd /libbb/error_msg.c | |
parent | cc165b9083e8e4fb01992a8e0d97ecf08cb6dcdd (diff) |
Split error messages into separate files.
Update libbb.h, per suggestion from Vladimir, to include __attribute__((format
(printf ...))) stuff
-Erik
Diffstat (limited to 'libbb/error_msg.c')
-rw-r--r-- | libbb/error_msg.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/libbb/error_msg.c b/libbb/error_msg.c index 7773d32a2..c7d5fdb98 100644 --- a/libbb/error_msg.c +++ b/libbb/error_msg.c @@ -31,15 +31,6 @@ #include <stdlib.h> #include "libbb.h" -extern const char *applet_name; - -static void verror_msg(const char *s, va_list p) -{ - fflush(stdout); - fprintf(stderr, "%s: ", applet_name); - vfprintf(stderr, s, p); -} - extern void error_msg(const char *s, ...) { va_list p; @@ -50,45 +41,6 @@ extern void error_msg(const char *s, ...) putc('\n', stderr); } -extern void error_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - verror_msg(s, p); - va_end(p); - putc('\n', stderr); - exit(EXIT_FAILURE); -} - -static void vperror_msg(const char *s, va_list p) -{ - int err=errno; - if(s == 0) s = ""; - verror_msg(s, p); - if (*s) s = ": "; - fprintf(stderr, "%s%s\n", s, strerror(err)); -} - -extern void perror_msg(const char *s, ...) -{ - va_list p; - - va_start(p, s); - vperror_msg(s, p); - va_end(p); -} - -extern void perror_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - vperror_msg(s, p); - va_end(p); - exit(EXIT_FAILURE); -} - /* END CODE */ /* |