aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index c8a1820d8..39ed1b66a 100644
--- a/utility.c
+++ b/utility.c
@@ -109,6 +109,23 @@ extern void fatalError(const char *s, ...)
exit(EXIT_FAILURE);
}
+extern void fatalPerror(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);
+ exit(EXIT_FAILURE);
+}
+
#if defined BB_INIT
/* Returns kernel version encoded as major*65536 + minor*256 + patch,
* so, for example, to check if the kernel is greater than 2.2.11: