get_terminal_width_height: do not pass insanely large values
[oweals/busybox.git] / libbb / error_msg_and_die.c
index f25a1da32e008a4f0b5fb21cb12971bb4c2e6406..10d953513079726675ba41500a5f1492ead2e88e 100644 (file)
@@ -13,6 +13,8 @@
 #include <stdlib.h>
 #include "libbb.h"
 
+int die_sleep;
+
 void bb_error_msg_and_die(const char *s, ...)
 {
        va_list p;
@@ -20,5 +22,7 @@ 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);
+       if (die_sleep)
+               sleep(die_sleep);
+       exit(xfunc_error_retval);
 }