openvt,getty,vfork_daemon_rexec,mount: tighten up fd cleanup code
[oweals/busybox.git] / libbb / error_msg_and_die.c
index f25a1da32e008a4f0b5fb21cb12971bb4c2e6406..7c5a4ebe93eeee5679782e6933417bb6029ec20c 100644 (file)
 #include <stdlib.h>
 #include "libbb.h"
 
+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;
@@ -20,5 +29,5 @@ void bb_error_msg_and_die(const char *s, ...)
        va_start(p, s);
        bb_verror_msg(s, p, NULL);
        va_end(p);
-       exit(bb_default_error_retval);
+       sleep_and_die();
 }