Skip to content

Commit

Permalink
win32: don't set error mode
Browse files Browse the repository at this point in the history
Commit a8c63f2 (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)
  • Loading branch information
rmyorston committed Jun 16, 2024
1 parent edf069f commit eb376b5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions libbb/appletlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,10 +1349,6 @@ int main(int argc UNUSED_PARAM, char **argv)
break;
}
}

/* Ignore critical errors, such as calling GetVolumeInformation() on
* a floppy or CDROM drive with no media. */
SetErrorMode(SEM_FAILCRITICALERRORS);
#endif

#if defined(__MINGW64_VERSION_MAJOR)
Expand Down

0 comments on commit eb376b5

Please # to comment.