dmidecode-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]