mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +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>
|
||||
|
||||
/* Linux */
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
@ -152,7 +153,10 @@ class Linux_driver : public Nic::Driver
|
||||
int ret;
|
||||
|
||||
/* 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 */
|
||||
do {
|
||||
ret = read(_tap_fd, _packet_buffer, sizeof(_packet_buffer));
|
||||
if (ret < 0) PERR("read: errno=%d", errno);
|
||||
} while (ret < 0);
|
||||
|
||||
void *buffer = _alloc.alloc(ret);
|
||||
|
Loading…
Reference in New Issue
Block a user