summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorMatt Kraai2000-10-25 17:00:36 +0000
committerMatt Kraai2000-10-25 17:00:36 +0000
commitef5529b27865adc79cd4d48f932d477b1d79b94e (patch)
tree88e77273fdc4f681859d3b3ef99507535c172f7b /utility.c
parent9133c98a9d5b26fd645d30f70c4cf994aea972e9 (diff)
downloadbusybox-ef5529b27865adc79cd4d48f932d477b1d79b94e.zip
busybox-ef5529b27865adc79cd4d48f932d477b1d79b94e.tar.gz
Added a new perrorMsg function, cleanup up error handling, fixed TRUE/FALSE
uses, and other minor fixes.
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index 39ed1b6..d61ef30 100644
--- a/utility.c
+++ b/utility.c
@@ -109,6 +109,22 @@ extern void fatalError(const char *s, ...)
exit(EXIT_FAILURE);
}
+extern void perrorMsg(const char *s, ...)
+{
+ va_list p;
+
+ va_start(p, s);
+ fflush(stdout);
+ fprintf(stderr, "%s: ", applet_name);
+ if (s && *s) {
+ vfprintf(stderr, s, p);
+ fputs(": ", stderr);
+ }
+ fprintf(stderr, "%s\n", strerror(errno));
+ va_end(p);
+ fflush(stderr);
+}
+
extern void fatalPerror(const char *s, ...)
{
va_list p;