diff options
-rw-r--r-- | include/libbb.h | 1 | ||||
-rw-r--r-- | include/mingw.h | 1 | ||||
-rw-r--r-- | libbb/appletlib.c | 2 | ||||
-rw-r--r-- | libbb/messages.c | 3 | ||||
-rw-r--r-- | shell/ash.c | 1 | ||||
-rw-r--r-- | win32/mingw.c | 6 |
6 files changed, 12 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h index d37d4e64c..9055ed066 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -2418,6 +2418,7 @@ extern const char bbvar[] ALIGN1; | |||
2418 | #define BB_SKIP_ANSI_EMULATION bbafter(BB_OVERRIDE_APPLETS) | 2418 | #define BB_SKIP_ANSI_EMULATION bbafter(BB_OVERRIDE_APPLETS) |
2419 | #define BB_TERMINAL_MODE bbafter(BB_SKIP_ANSI_EMULATION) | 2419 | #define BB_TERMINAL_MODE bbafter(BB_SKIP_ANSI_EMULATION) |
2420 | #define BB_SYSTEMROOT bbafter(BB_TERMINAL_MODE) | 2420 | #define BB_SYSTEMROOT bbafter(BB_TERMINAL_MODE) |
2421 | #define BB_CRITICAL_ERROR_DIALOGS bbafter(BB_SYSTEMROOT) | ||
2421 | #endif | 2422 | #endif |
2422 | 2423 | ||
2423 | extern const int const_int_0; | 2424 | extern const int const_int_0; |
diff --git a/include/mingw.h b/include/mingw.h index fae732332..93fad0605 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -639,3 +639,4 @@ char *quote_arg(const char *arg); | |||
639 | char *find_first_executable(const char *name); | 639 | char *find_first_executable(const char *name); |
640 | char *xappendword(const char *str, const char *word); | 640 | char *xappendword(const char *str, const char *word); |
641 | int windows_env(void); | 641 | int windows_env(void); |
642 | void change_critical_error_dialogs(const char *newval) FAST_FUNC; | ||
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index c90285ae9..121959376 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1352,7 +1352,7 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
1352 | 1352 | ||
1353 | /* Have this process handle critical errors itself: the default | 1353 | /* Have this process handle critical errors itself: the default |
1354 | * system-generated error dialogs may be inconvenient. */ | 1354 | * system-generated error dialogs may be inconvenient. */ |
1355 | SetErrorMode(SEM_FAILCRITICALERRORS); | 1355 | change_critical_error_dialogs(getenv(BB_CRITICAL_ERROR_DIALOGS) ?: ""); |
1356 | #endif | 1356 | #endif |
1357 | 1357 | ||
1358 | #if defined(__MINGW64_VERSION_MAJOR) | 1358 | #if defined(__MINGW64_VERSION_MAJOR) |
diff --git a/libbb/messages.c b/libbb/messages.c index 12079a2e0..27ba244d6 100644 --- a/libbb/messages.c +++ b/libbb/messages.c | |||
@@ -47,7 +47,8 @@ const char bbvar[] ALIGN1 = | |||
47 | "BB_OVERRIDE_APPLETS\0" \ | 47 | "BB_OVERRIDE_APPLETS\0" \ |
48 | "BB_SKIP_ANSI_EMULATION\0" \ | 48 | "BB_SKIP_ANSI_EMULATION\0" \ |
49 | "BB_TERMINAL_MODE\0" \ | 49 | "BB_TERMINAL_MODE\0" \ |
50 | "BB_SYSTEMROOT\0"; | 50 | "BB_SYSTEMROOT\0" \ |
51 | "BB_CRITICAL_ERROR_DIALOGS\0"; | ||
51 | #endif | 52 | #endif |
52 | const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL; | 53 | const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL; |
53 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | 54 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, |
diff --git a/shell/ash.c b/shell/ash.c index ad77689e7..817b5635f 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2443,6 +2443,7 @@ static const struct { | |||
2443 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_SKIP_ANSI_EMULATION, change_terminal_mode }, | 2443 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_SKIP_ANSI_EMULATION, change_terminal_mode }, |
2444 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_TERMINAL_MODE, change_terminal_mode }, | 2444 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_TERMINAL_MODE, change_terminal_mode }, |
2445 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_OVERRIDE_APPLETS, change_override_applets }, | 2445 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_OVERRIDE_APPLETS, change_override_applets }, |
2446 | { VSTRFIXED|VTEXTFIXED|VUNSET, BB_CRITICAL_ERROR_DIALOGS, change_critical_error_dialogs }, | ||
2446 | #endif | 2447 | #endif |
2447 | }; | 2448 | }; |
2448 | 2449 | ||
diff --git a/win32/mingw.c b/win32/mingw.c index 4398f5462..49e1bcfa4 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -2507,3 +2507,9 @@ windows_env(void) | |||
2507 | } | 2507 | } |
2508 | return FALSE; | 2508 | return FALSE; |
2509 | } | 2509 | } |
2510 | |||
2511 | void FAST_FUNC | ||
2512 | change_critical_error_dialogs(const char *newval) | ||
2513 | { | ||
2514 | SetErrorMode(strcmp(newval, "1") == 0 ? 0 : SEM_FAILCRITICALERRORS); | ||
2515 | } | ||