convert calloc to xzalloc

fix sleep-on-die option
This commit is contained in:
Denis Vlasenko
2007-01-03 02:56:00 +00:00
parent bb3d0fab3b
commit 9b1381fd2f
9 changed files with 44 additions and 45 deletions

View File

@@ -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();
}