]> git.ipfire.org Git - thirdparty/systemd.git/commit
gpt-auto-generator: "translate" errno codes into proper messages 27323/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 18 Apr 2023 09:33:08 +0000 (11:33 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 18 Apr 2023 09:58:33 +0000 (11:58 +0200)
commit4953e39c70430e2d46915f8a626ac14fdf31b3d3
treeea8b9b0ed87be33f42e74c16ad599108770bb900
parentde47cd061097164fff4ca901b703df32604c655e
gpt-auto-generator: "translate" errno codes into proper messages

E.g. in logs on jammy-ppc64el in https://github.com/systemd/systemd/pull/27294:
Apr 16 17:42:50 H systemd-gpt-auto-generator[300]: Failed to dissect partition table of block device /dev/sda: No message of desired type
Apr 16 17:42:50 H (sd-execu[295]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.

ee0e6e476e61d4baa2a18e241d212753e75003bf made this particular condition not an
error. But for other errnos we want to print a better message too.
dissect_loop_device_and_warn() already does this, but it always prints the
error at error level. We want to suppress some of the errors, so let's make the
print helper public and do the error suppression in the caller.
src/gpt-auto-generator/gpt-auto-generator.c
src/shared/dissect-image.c
src/shared/dissect-image.h