]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
return kernel-supplied error if available.
authorluigi <luigi@FreeBSD.org>
Mon, 10 Nov 2014 08:31:56 +0000 (08:31 +0000)
committerluigi <luigi@FreeBSD.org>
Mon, 10 Nov 2014 08:31:56 +0000 (08:31 +0000)
Also fix field names in a comment.

sys/net/netmap_user.h

index 5faf671b897663371ded07b4ff213ca824af5df9..aab6c358de739733a2facb05640d314fd9ba239f 100644 (file)
@@ -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;
 }