HomePhabricator

util: Refactor SysErrorString logic

Description

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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D16210

Details

Provenance
laanwj <126646+laanwj@users.noreply.github.com>Authored on Apr 20 2022, 14:43
PiRKCommitted on Thu, May 23, 19:11
PiRKPushed on Thu, May 23, 19:11
Reviewer
Restricted Project
Differential Revision
D16210: util: Refactor SysErrorString logic
Parents
rABC66e9e23fe2f8: util: Replace non-threadsafe strerror
Branches
Unknown
Tags
Unknown

Event Timeline