You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
systemError(boost::system::errc::X) reads errno values as Win32 codes on Windows #19745
systemError(boost::system::errc::X, location) has no overload for boost's errc_t, so it binds to systemError(int, ...) and builds a system_category() code. On Windows that category holds Win32 codes, so the errno value is read as a Win32 error code and the message is Win32's text for that number. Some values land on a matching Win32 code by coincidence (ENOENT and ERROR_FILE_NOT_FOUND are both 2); others don't. errc::is_a_directory (21) is ERROR_NOT_READY, so loadhistory() of a directory reported "The device is not ready". #19689 fixes that call, and the missing-file call beside it, by passing std::make_error_code(std::errc::X).
git grep 'systemError(boost::system::errc::' -- src/cpp finds 365 such calls.
Possible fix
Add a systemError() overload for boost::system::errc::errc_t that builds the code in generic_category(), as std::make_error_code(std::errc::X) does, so every one of these errors gets the errc's own message on every platform.
Windows not-found checks.isNotFoundError() compares against windows_error::file_not_found (system category, 2). An error built from systemError(errc::no_such_file_or_directory) matches it today only because both are 2, and would stop matching in the generic category.
Message text. MSVC's generic messages are lower case ("no such file or directory"), so user-facing text changes on Windows. Tests that match the Win32 text would need updating.
Activity
route enum arguments to systemError() through their own category
pass errc values instead of errno constants to systemError()
report zlib and mach return codes in their own categories
catch the remaining errno-as-system-code spellings
tighten the errno lint and test an unscoped error code enum
point std error code enums at std::error_code(value)
read errno before building the error location
compare error codes as conditions and keep stream write errors whole
use the errc overloads for history load errors
add genericError() for errno values
check _WIN32 regions in the errno lint
cover more _WIN32 branch forms in the errno lint
keep generic errors classifiable where checks compared exact codes
qualify asio eof to avoid the windows crt ::eof clash
read errno before cleanup; retry address_in_use by condition
store errno errors as generic on posix, whoever reports them
free failed listeners on retry; report files in use; add news
leak the display name; read iconv errno first; widen the condition lint
pick error categories from the code's type (#19753)