From: Mike Yuan Date: Thu, 26 Mar 2026 16:12:43 +0000 (+0100) Subject: various: attach errno to structured logs, even if not used in msg X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=c2624fe9a77206aeae399b772efc24fb10b3cd73;p=thirdparty%2Fsystemd.git various: attach errno to structured logs, even if not used in msg --- diff --git a/src/imds/imds-generator.c b/src/imds/imds-generator.c index ccef9fa36c0..08175df3e58 100644 --- a/src/imds/imds-generator.c +++ b/src/imds/imds-generator.c @@ -95,7 +95,7 @@ static int smbios_query(void) { _cleanup_free_ char *modalias = NULL; r = smbios_get_modalias(&modalias); if (r == -ENOENT) { - log_debug("No DMI device found, assuming IMDS is not available."); + log_debug_errno(r, "No DMI device found, assuming IMDS is not available."); return false; } if (r < 0) diff --git a/src/pcrlock/pcrlock.c b/src/pcrlock/pcrlock.c index ecb0bb30e6b..33b35ac4142 100644 --- a/src/pcrlock/pcrlock.c +++ b/src/pcrlock/pcrlock.c @@ -927,7 +927,7 @@ static int event_log_load_firmware(EventLog *el) { r = read_full_file(path, (char**) &buf, &bufsize); if (r == -ENOENT) { - log_notice("No '%s' file, assuming TPM without firmware support.", path); + log_notice_errno(r, "No '%s' file, assuming TPM without firmware support.", path); return 0; } if (r < 0) diff --git a/src/tpm2-setup/tpm2-generator.c b/src/tpm2-setup/tpm2-generator.c index 7a826a0be18..6c27fa106af 100644 --- a/src/tpm2-setup/tpm2-generator.c +++ b/src/tpm2-setup/tpm2-generator.c @@ -92,7 +92,7 @@ static int generate_swtpm_symlink(Tpm2Support support) { r = find_executable("swtpm", /* ret_filename= */ NULL); if (r == -ENOENT) { - log_warning("TPM software fallback requested but swtpm not available, not pulling in software TPM unit."); + log_warning_errno(r, "TPM software fallback requested but swtpm not available, not pulling in software TPM unit."); return 0; } if (r < 0)