Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-03 05:56:00 +0300
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-03 05:56:00 +0300
commit9b1381fd2fb7179f731709542507015799f90a51 (patch)
tree66b3617e0b6ceed9c3123000104df0d78bf9bf2a /libbb/error_msg_and_die.c
parentbb3d0fab3b46d64e93687bc30b405d0878eca296 (diff)
convert calloc to xzalloc
fix sleep-on-die option
Diffstat (limited to 'libbb/error_msg_and_die.c')
-rw-r--r--libbb/error_msg_and_die.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c
index 10d953513..7c5a4ebe9 100644
--- a/libbb/error_msg_and_die.c
+++ b/libbb/error_msg_and_die.c
@@ -15,6 +15,13 @@
int die_sleep;
+void sleep_and_die(void)
+{
+ if (die_sleep)
+ sleep(die_sleep);
+ exit(xfunc_error_retval);
+}
+
void bb_error_msg_and_die(const char *s, ...)
{
va_list p;
@@ -22,7 +29,5 @@ void bb_error_msg_and_die(const char *s, ...)
va_start(p, s);
bb_verror_msg(s, p, NULL);
va_end(p);
- if (die_sleep)
- sleep(die_sleep);
- exit(xfunc_error_retval);
+ sleep_and_die();
}