diff options
Diffstat (limited to 'libbb/error_msg_and_die.c')
-rw-r--r-- | libbb/error_msg_and_die.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c index 7c5a4ebe9..39178a3ce 100644 --- a/libbb/error_msg_and_die.c +++ b/libbb/error_msg_and_die.c | |||
@@ -7,18 +7,19 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <stdio.h> | ||
11 | #include <errno.h> | ||
12 | #include <string.h> | ||
13 | #include <stdlib.h> | ||
14 | #include "libbb.h" | 10 | #include "libbb.h" |
15 | 11 | ||
16 | int die_sleep; | 12 | int die_sleep; |
13 | jmp_buf die_jmp; | ||
17 | 14 | ||
18 | void sleep_and_die(void) | 15 | void sleep_and_die(void) |
19 | { | 16 | { |
20 | if (die_sleep) | 17 | if (die_sleep) { |
18 | /* Special case: don't die, but jump */ | ||
19 | if (die_sleep < 0) | ||
20 | longjmp(die_jmp, xfunc_error_retval); | ||
21 | sleep(die_sleep); | 21 | sleep(die_sleep); |
22 | } | ||
22 | exit(xfunc_error_retval); | 23 | exit(xfunc_error_retval); |
23 | } | 24 | } |
24 | 25 | ||