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

View File

@@ -15,10 +15,7 @@
void fflush_stdout_and_exit(int retval)
{
if (fflush(stdout)) {
retval = xfunc_error_retval;
}
if (die_sleep)
sleep(die_sleep);
if (fflush(stdout))
sleep_and_die();
exit(retval);
}

View File

@@ -19,7 +19,5 @@ void bb_herror_msg_and_die(const char *s, ...)
va_start(p, s);
bb_vherror_msg(s, p);
va_end(p);
if (die_sleep)
sleep(die_sleep);
exit(xfunc_error_retval);
sleep_and_die();
}

View File

@@ -20,7 +20,5 @@ void bb_perror_msg_and_die(const char *s, ...)
va_start(p, s);
bb_vperror_msg(s, p);
va_end(p);
if (die_sleep)
sleep(die_sleep);
exit(xfunc_error_retval);
sleep_and_die();
}