summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2014-11-10 08:31:56 +0000
committerluigi <luigi@FreeBSD.org>2014-11-10 08:31:56 +0000
commit02cd0a8cd68b8db488add1997d8762a5d6048bd7 (patch)
treefccb9e9283439f0a4d398b84e0d3c8d65eb02897
parentfe03d9b9d26fcae476fe7e7fa57516b0fa684089 (diff)
downloadFreeBSD-src-02cd0a8cd68b8db488add1997d8762a5d6048bd7.zip
FreeBSD-src-02cd0a8cd68b8db488add1997d8762a5d6048bd7.tar.gz
return kernel-supplied error if available.
Also fix field names in a comment.
-rw-r--r--sys/net/netmap_user.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/netmap_user.h b/sys/net/netmap_user.h
index 5faf671..aab6c35 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;
}
OpenPOWER on IntegriCloud