aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-06-16 08:07:46 +0100
committerRon Yorston <rmy@pobox.com>2024-06-16 08:07:46 +0100
commiteb376b5d196358dafe454a4778746e46bad48ee7 (patch)
tree48a596e6fda67e59e1266f44c85360dc231723e3
parentedf069ffc299d88c2291c20736bd1463ff030e12 (diff)
downloadbusybox-w32-eb376b5d196358dafe454a4778746e46bad48ee7.tar.gz
busybox-w32-eb376b5d196358dafe454a4778746e46bad48ee7.tar.bz2
busybox-w32-eb376b5d196358dafe454a4778746e46bad48ee7.zip
win32: don't set error mode
Commit a8c63f25b3 (win32: improve filesystem detection and display) added a call to SetErrorMode(SEM_FAILCRITICALERRORS). This was on the strength of the documentation for GetVolumeInformation() which suggests that otherwise a message box will appear to prompt the user to put media in an empty floppy or CD drive. This would disrupt the expected behaviour of applets like 'df'. In practice it seems the call to SetErrorMode() is unnecessary. It also results in other errors going unreported. Remove the call to SetErrorMode(). Saves 8-20 bytes. (GitHub issue #423)
-rw-r--r--libbb/appletlib.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 1f9968f10..51824f1b3 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1349,10 +1349,6 @@ int main(int argc UNUSED_PARAM, char **argv)
1349 break; 1349 break;
1350 } 1350 }
1351 } 1351 }
1352
1353 /* Ignore critical errors, such as calling GetVolumeInformation() on
1354 * a floppy or CDROM drive with no media. */
1355 SetErrorMode(SEM_FAILCRITICALERRORS);
1356#endif 1352#endif
1357 1353
1358#if defined(__MINGW64_VERSION_MAJOR) 1354#if defined(__MINGW64_VERSION_MAJOR)