diff options
author | Matt Kraai | 2000-10-25 17:00:36 +0000 |
---|---|---|
committer | Matt Kraai | 2000-10-25 17:00:36 +0000 |
commit | ef5529b27865adc79cd4d48f932d477b1d79b94e (patch) | |
tree | 88e77273fdc4f681859d3b3ef99507535c172f7b /utility.c | |
parent | 9133c98a9d5b26fd645d30f70c4cf994aea972e9 (diff) | |
download | busybox-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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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; |