aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-06-22 10:40:16 +0100
committerRon Yorston <rmy@pobox.com>2024-06-22 12:26:19 +0100
commit790e37727319c3dd9c2d4e45dac9b6cc38a5d25f (patch)
treeb375a322562dd6691b7eaf139d2b7b844b31ccb9 /libbb/appletlib.c
parent91226ced0a04302dfe04227aff062cade476a930 (diff)
downloadbusybox-w32-790e37727319c3dd9c2d4e45dac9b6cc38a5d25f.tar.gz
busybox-w32-790e37727319c3dd9c2d4e45dac9b6cc38a5d25f.tar.bz2
busybox-w32-790e37727319c3dd9c2d4e45dac9b6cc38a5d25f.zip
win32: revert 'don't set error mode'
Commit eb376b5d1 (win32: don't set error mode) removed a call to SetErrorMode(SEM_FAILCRITICALERRORS). But the documentation says: Best practice is that all applications call the process-wide SetErrorMode function with a parameter of SEM_FAILCRITICALERRORS at startup. This is to prevent error mode dialogs from hanging the application. Doing this prevents the system from displaying useful information, though. The application should attempt to tell the user what went wrong. Reinstate the call to SetErrorMode() and try to provide an error message, at least for the situation mentioned in issue #423 and other similar cases. Adds 360-368 bytes. (GitHub issue #423)
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 51824f1b3..c90285ae9 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1349,6 +1349,10 @@ int main(int argc UNUSED_PARAM, char **argv)
1349 break; 1349 break;
1350 } 1350 }
1351 } 1351 }
1352
1353 /* Have this process handle critical errors itself: the default
1354 * system-generated error dialogs may be inconvenient. */
1355 SetErrorMode(SEM_FAILCRITICALERRORS);
1352#endif 1356#endif
1353 1357
1354#if defined(__MINGW64_VERSION_MAJOR) 1358#if defined(__MINGW64_VERSION_MAJOR)