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, ...)
109 exit(EXIT_FAILURE); 109 exit(EXIT_FAILURE);
110} 110}
111 111
112extern void fatalPerror(const char *s, ...)
113{
114 va_list p;
115
116 va_start(p, s);
117 fflush(stdout);
118 fprintf(stderr, "%s: ", applet_name);
119 if (s && *s) {
120 vfprintf(stderr, s, p);
121 fputs(": ", stderr);
122 }
123 fprintf(stderr, "%s\n", strerror(errno));
124 va_end(p);
125 fflush(stderr);
126 exit(EXIT_FAILURE);
127}
128
112#if defined BB_INIT 129#if defined BB_INIT
113/* Returns kernel version encoded as major*65536 + minor*256 + patch, 130/* Returns kernel version encoded as major*65536 + minor*256 + patch,
114 * so, for example, to check if the kernel is greater than 2.2.11: 131 * so, for example, to check if the kernel is greater than 2.2.11: