mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
nic: log errors in base-linux nic_drv
This commit is contained in:
parent
7abc1733c5
commit
6f58cdffb6
@ -30,6 +30,7 @@
|
|||||||
#include <nic/xml_node.h>
|
#include <nic/xml_node.h>
|
||||||
|
|
||||||
/* Linux */
|
/* Linux */
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
@ -152,7 +153,10 @@ class Linux_driver : public Nic::Driver
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* blocking-write packet to TAP */
|
/* blocking-write packet to TAP */
|
||||||
do { ret = write(_tap_fd, packet, size); } while (ret < 0);
|
do {
|
||||||
|
ret = write(_tap_fd, packet, size);
|
||||||
|
if (ret < 0) PERR("write: errno=%d", errno);
|
||||||
|
} while (ret < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -167,6 +171,7 @@ class Linux_driver : public Nic::Driver
|
|||||||
/* blocking read incoming packet */
|
/* blocking read incoming packet */
|
||||||
do {
|
do {
|
||||||
ret = read(_tap_fd, _packet_buffer, sizeof(_packet_buffer));
|
ret = read(_tap_fd, _packet_buffer, sizeof(_packet_buffer));
|
||||||
|
if (ret < 0) PERR("read: errno=%d", errno);
|
||||||
} while (ret < 0);
|
} while (ret < 0);
|
||||||
|
|
||||||
void *buffer = _alloc.alloc(ret);
|
void *buffer = _alloc.alloc(ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user