fix several bugs

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-19 15:39:34 +02:00
parent 48ac061ab6
commit eea841440d
10 changed files with 89 additions and 90 deletions

View file

@ -26,7 +26,7 @@ send_card_buffer (struct grub_net_card *dev __attribute__ ((unused)),
return GRUB_ERR_NONE;
}
static grub_size_t
static grub_ssize_t
get_card_packet (struct grub_net_card *dev __attribute__ ((unused)),
struct grub_net_buff *pack)
{
@ -35,10 +35,7 @@ get_card_packet (struct grub_net_card *dev __attribute__ ((unused)),
grub_netbuff_clear(pack);
actual = read (fd, pack->data, 1500);
if (actual < 0)
{
grub_error (GRUB_ERR_IO, "couldn't receive packets");
return -1;
}
return -1;
grub_netbuff_put (pack, actual);
return actual;
@ -65,7 +62,6 @@ static struct grub_net_card emucard =
GRUB_MOD_INIT(emunet)
{
struct ifreq ifr;
// char fullname[64];
fd = open ("/dev/net/tun", O_RDWR | O_NONBLOCK);
if (fd < 0)
return;