aboutsummaryrefslogtreecommitdiff
path: root/libbb/error_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/error_msg.c')
-rw-r--r--libbb/error_msg.c48
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 @@
31#include <stdlib.h> 31#include <stdlib.h>
32#include "libbb.h" 32#include "libbb.h"
33 33
34extern const char *applet_name;
35
36static void verror_msg(const char *s, va_list p)
37{
38 fflush(stdout);
39 fprintf(stderr, "%s: ", applet_name);
40 vfprintf(stderr, s, p);
41}
42
43extern void error_msg(const char *s, ...) 34extern void error_msg(const char *s, ...)
44{ 35{
45 va_list p; 36 va_list p;
@@ -50,45 +41,6 @@ extern void error_msg(const char *s, ...)
50 putc('\n', stderr); 41 putc('\n', stderr);
51} 42}
52 43
53extern void error_msg_and_die(const char *s, ...)
54{
55 va_list p;
56
57 va_start(p, s);
58 verror_msg(s, p);
59 va_end(p);
60 putc('\n', stderr);
61 exit(EXIT_FAILURE);
62}
63
64static void vperror_msg(const char *s, va_list p)
65{
66 int err=errno;
67 if(s == 0) s = "";
68 verror_msg(s, p);
69 if (*s) s = ": ";
70 fprintf(stderr, "%s%s\n", s, strerror(err));
71}
72
73extern void perror_msg(const char *s, ...)
74{
75 va_list p;
76
77 va_start(p, s);
78 vperror_msg(s, p);
79 va_end(p);
80}
81
82extern void perror_msg_and_die(const char *s, ...)
83{
84 va_list p;
85
86 va_start(p, s);
87 vperror_msg(s, p);
88 va_end(p);
89 exit(EXIT_FAILURE);
90}
91
92 44
93/* END CODE */ 45/* END CODE */
94/* 46/*