Skip to content

Commit 95dfe92

Browse files
poetteringbluca
authored andcommitted
import-creds: when we hit ENOENT on SMBIOS 11 do not even debug log
We'll *always* hit ENEOENT when iterating through SMBIOS type #11 fields, on the last one. it's very confusing to debug log about that, let's just not do it. (cherry picked from commit 5202ee4) (cherry picked from commit 995c702) (cherry picked from commit f084959) (cherry picked from commit b5f3e79) (cherry picked from commit 62f8196)
1 parent ee386d7 commit 95dfe92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/import-creds.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,11 @@ static int import_credentials_smbios(ImportCredentialContext *c) {
585585
return log_oom();
586586

587587
r = read_virtual_file(p, sizeof(dmi_field_header) + CREDENTIALS_TOTAL_SIZE_MAX, (char**) &data, &size);
588+
if (r == -ENOENT) /* Once we reach ENOENT there are no more DMI Type 11 fields around. */
589+
break;
588590
if (r < 0) {
589591
/* Once we reach ENOENT there are no more DMI Type 11 fields around. */
590-
log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r, "Failed to open '%s', ignoring: %m", p);
592+
log_warning_errno(r, "Failed to open '%s', ignoring: %m", p);
591593
break;
592594
}
593595

0 commit comments

Comments
 (0)