Page MenuHomePhabricator

util: Refactor SysErrorString logic
ClosedPublic

Authored by PiRK on May 23 2024, 10:49.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC50efdc2baaa0: util: Refactor SysErrorString logic
Summary

util: Use strerror_s for SysErrorString on Windows

https://github.com/bitcoin/bitcoin/pull/24933/commits/e7f2f77756d33c6be9c8998a575b263ff2d39270

util: Refactor SysErrorString logic

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.

https://github.com/bitcoin/bitcoin/pull/24933/commits/718da302c7b11b375042c3000d421fd93348c199

util: Increase buffer size to 1024 in SysErrorString

Increase the error message buffer to 1024 as recommended in the manual
page (Thanks Jon Atack)

https://github.com/bitcoin/bitcoin/pull/24933/commits/f00fb1265a8bc26e1612c771173325dbe49b3612

This concludes backport of core#24933
Depends on D16209

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable