[coreboot-gerrit] Change in coreboot[master]: intelmetool: Print strerror() results for mmap errors

Martin Roth (Code Review) gerrit at coreboot.org
Fri May 5 22:37:30 CEST 2017


Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/19560 )

Change subject: intelmetool: Print strerror() results for mmap errors
......................................................................


intelmetool: Print strerror() results for mmap errors

These are more human readable for folks not familiar with errno values.

Change-Id: I21352a00b583163472ccd3302a83adf1f8396c61
Signed-off-by: Paul Wise <pabs3 at bonedaddy.net>
Reviewed-on: https://review.coreboot.org/19560
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
---
M util/intelmetool/mmap.c
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Paul Menzel: Looks good to me, but someone else must approve
  Philipp Deppenwiese: Looks good to me, approved
  build bot (Jenkins): Verified



diff --git a/util/intelmetool/mmap.c b/util/intelmetool/mmap.c
index 041aac9..2462b22 100644
--- a/util/intelmetool/mmap.c
+++ b/util/intelmetool/mmap.c
@@ -15,6 +15,7 @@
 
 #include "mmap.h"
 #include <errno.h>
+#include <string.h>
 
 #ifndef __DARWIN__
 int fd_mem;
@@ -28,8 +29,8 @@
 
   if (virt_addr == MAP_FAILED) {
     err = errno;
-    printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d\n",
-            (intmax_t)phys_addr, len, err);
+    printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d %s\n",
+            (intmax_t)phys_addr, len, err, strerror(err));
     return NULL;
   }
 
@@ -44,8 +45,8 @@
 
   if (virt_addr == MAP_FAILED) {
     err = errno;
-    printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d\n",
-            (intmax_t)phys_addr, len, err);
+    printf("Error mapping physical memory 0x%016jd [0x%zx] ERRNO=%d %s\n",
+            (intmax_t)phys_addr, len, err, strerror(err));
     return NULL;
   }
 

-- 
To view, visit https://review.coreboot.org/19560
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I21352a00b583163472ccd3302a83adf1f8396c61
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Paul Wise (Debian) <pabs at debian.org>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>



More information about the coreboot-gerrit mailing list