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@bonedaddy.net Reviewed-on: https://review.coreboot.org/19560 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: Philipp Deppenwiese zaolin.daisuki@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; }