aboutsummaryrefslogtreecommitdiff
path: root/src/util/syserror.cpp
AgeCommit message (Collapse)Author
2023-06-30Show descriptive error messages when FileCommit failsJohn Moffett
Only raw errno codes are logged if FileCommit fails. These are implementation-specific, so it makes it harder to debug based on user reports. Instead, use SysErrorString to display both the raw int value and the descriptive message.
2022-07-08refactor: add most of src/util to iwyufanquake
These files change infrequently, and not much header shuffling is required. We don't add everything in src/util/ yet, because IWYU makes some dubious suggestions, which I'm going to follow up with upstream.
2022-04-28util: Increase buffer size to 1024 in SysErrorStringlaanwj
Increase the error message buffer to 1024 as recommended in the manual page (Thanks Jon Atack)
2022-04-28util: Refactor SysErrorString logiclaanwj
Deduplicate code and error checks by making sure `s` stays `nullptr` in case of error. Return "Unknown error" instead of an empty string in this case.
2022-04-28util: Use strerror_s for SysErrorString on Windowslaanwj
2022-04-28util: Replace non-threadsafe strerrorlaanwj
Some uses of non-threadsafe `strerror` have snuck into the code since they were removed in #4152. Add a wrapper `SysErrorString` for thread-safe strerror alternatives and replace all uses of `strerror` with this.