diff mbox

[rdma-core,1/3] ibacm: acm_util.c: Better log message when ioctl fails in acm_if_iter_sys

Message ID 6dc90dcf-d6df-dffd-5c07-728ebdae249f@dev.mellanox.co.il (mailing list archive)
State Accepted
Headers show

Commit Message

Hal Rosenstock Oct. 25, 2017, 1:41 p.m. UTC
RETURN VALUE for ioctl says:
On error, -1 is returned, and errno is set appropriately.

Rather than log the return value, use the string for errno.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 ibacm/src/acm_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/ibacm/src/acm_util.c b/ibacm/src/acm_util.c
index aca042d..b50fd74 100644
--- a/ibacm/src/acm_util.c
+++ b/ibacm/src/acm_util.c
@@ -152,7 +152,7 @@  int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx)
 
 	ret = ioctl(s, SIOCGIFCONF, ifc);
 	if (ret < 0) {
-		acm_log(0, "ioctl ifconf error %d\n", ret);
+		acm_log(0, "ioctl ifconf error: %s\n", strerror(errno));
 		goto out2;
 	}