[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dmidecode] [PATCH 7/8] dmidecode: Move type 42 warning messages to stde
From: |
Jean Delvare |
Subject: |
[dmidecode] [PATCH 7/8] dmidecode: Move type 42 warning messages to stderr |
Date: |
Mon, 16 Mar 2020 10:44:09 +0100 |
Write warning messages about invalid type 42 structures to stderr as
we do for all other warning messages.
Also include the handle and record numbers in these warning messages
to make the problem easier to analyze.
Signed-off-by: Jean Delvare <address@hidden>
---
dmidecode.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- dmidecode.orig/dmidecode.c 2020-03-13 16:22:59.516249509 +0100
+++ dmidecode/dmidecode.c 2020-03-13 16:25:26.952040621 +0100
@@ -3780,8 +3780,9 @@ static void dmi_parse_controller_structu
total_read++;
if (total_read > h->length)
{
- printf("%s\tWARN: Total read length %d exceeds total structure
length %d\n",
- prefix, total_read, h->length);
+ fprintf(stderr,
+ "Total read length %d exceeds total structure length %d
(handle 0x%04hx)\n",
+ total_read, h->length, h->handle);
return;
}
@@ -3801,8 +3802,9 @@ static void dmi_parse_controller_structu
total_read += rec[1] + 2;
if (total_read > h->length)
{
- printf("%s\tWARN: Total read length %d exceeds
total structure length %d\n",
- prefix, total_read, h->length);
+ fprintf(stderr,
+ "Total read length %d exceeds total
structure length %d (handle 0x%04hx, record %d)\n",
+ total_read, h->length, h->handle, i +
1);
return;
}
--
Jean Delvare
SUSE L3 Support
- [dmidecode] [PATCH 0/8] dmidecode: Minors fixes and clean-ups, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 1/8] dmidecode: Print type 33 name unconditionally, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 2/8] dmidecode: Don't choke on invalid processor voltage, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 3/8] dmidecode: Simplify the formatting of memory error status, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 4/8] dmidecode: Fix the alignment of type 25 name, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 5/8] dmidecode: Code indentation fixes, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 6/8] dmidecode: Reduce the indentation of type 42 structures, Jean Delvare, 2020/03/16
- [dmidecode] [PATCH 7/8] dmidecode: Move type 42 warning messages to stderr,
Jean Delvare <=
- [dmidecode] [PATCH 8/8] dmidecode: Refactor ASCII filtering of DMI strings, Jean Delvare, 2020/03/16