]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Add a function to print Windows specific error messages.
authorJia Tan <jiat0218@gmail.com>
Sat, 21 Oct 2023 12:32:05 +0000 (20:32 +0800)
committerJia Tan <jiat0218@gmail.com>
Mon, 29 Jan 2024 13:40:53 +0000 (21:40 +0800)
commitd6d1e40f195440b198e6c57d5283b63037dcee92
tree7d0ee878e3577d265e5575d34cb6b6540bad5f96
parentb43c3e48bf6097095eef36d44cdbec811074940a
xz: Add a function to print Windows specific error messages.

Native Windows C API functions do not use errno, but instead have to
call GetLastError(). There is not an easy way to convert this error
code into a helpful message, so this creates a wrapper around the
slightly complicated FormatMessage() function.

The new message_windows_error() function calls message_error() under the
hood, so it will set the exit status to 1.
src/xz/message.c
src/xz/message.h