From 0506889c15d39b8edb35bf871ef1f35112a13e1e Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Mon, 10 Nov 2014 08:31:56 +0000 Subject: [PATCH] return kernel-supplied error if available. Also fix field names in a comment. --- sys/net/netmap_user.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/net/netmap_user.h b/sys/net/netmap_user.h index 5faf671b897..aab6c358de7 100644 --- a/sys/net/netmap_user.h +++ b/sys/net/netmap_user.h @@ -40,7 +40,7 @@ * From there: * struct netmap_ring *NETMAP_TXRING(nifp, index) * struct netmap_ring *NETMAP_RXRING(nifp, index) - * we can access ring->nr_cur, ring->nr_avail, ring->nr_flags + * we can access ring->cur, ring->head, ring->tail, etc. * * ring->slot[i] gives us the i-th slot (we can access * directly len, flags, buf_idx) @@ -543,7 +543,8 @@ fail: nm_close(d); if (errmsg) D("%s %s", errmsg, ifname); - errno = EINVAL; + if (errno == 0) + errno = EINVAL; return NULL; }