summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2020-10-09 21:58:35 -0600
committerGitHub <noreply@github.com>2020-10-09 21:58:35 -0600
commit52f2cfc67f912d0be7bef0511c0529159b65d779 (patch)
tree6a772a0b601df6b3f4b713e65cf939cae5cab87c /utils
parent92937504b19f7b603e3a0cc6c1693d95651f43e9 (diff)
downloadbcm5719-ortega-52f2cfc67f912d0be7bef0511c0529159b65d779.tar.gz
bcm5719-ortega-52f2cfc67f912d0be7bef0511c0529159b65d779.zip
bcmflash: Improve debugging when ethtool reports an error. (#134)
Diffstat (limited to 'utils')
-rw-r--r--utils/bcmflash/ethtool.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/bcmflash/ethtool.c b/utils/bcmflash/ethtool.c
index 1e854b7..76d2ed3 100644
--- a/utils/bcmflash/ethtool.c
+++ b/utils/bcmflash/ethtool.c
@@ -42,6 +42,7 @@
/// @endcond
////////////////////////////////////////////////////////////////////////////////
+#include <errno.h>
#include <linux/ethtool.h>
#include <linux/sockios.h>
#include <malloc.h>
@@ -81,7 +82,8 @@ size_t bcmflash_ethtool_size(const char *name)
drvinfo.cmd = ETHTOOL_GDRVINFO;
if (do_ioctl(&ctx, &drvinfo) < 0)
{
- printf("Cannot get driver information\n");
+ const char *errstr = strerror(errno);
+ printf("Cannot get driver information, %d: %s\n", errno, errstr);
return 0;
}
@@ -115,7 +117,8 @@ bool bcmflash_ethtool_read(const char *name, void *buffer, size_t len)
if (do_ioctl(&ctx, eeprom) < 0)
{
- printf("Cannot read eeprom");
+ const char *errstr = strerror(errno);
+ printf("Cannot read eeprom, %d: %s\n", errno, errstr);
free(eeprom);
return false;
}
OpenPOWER on IntegriCloud