aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/netfront.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-06-18 09:32:50 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-06-18 09:32:50 +0100
commit0a9b2d786bbda43e056ae835dba758a74c26ec43 (patch)
tree93f16507bd958ff34fea933bfc1ee19c4f199acc /extras/mini-os/netfront.c
parentdbd56b5c30b26127b97504cbd560bf9460a04d26 (diff)
downloadxen-0a9b2d786bbda43e056ae835dba758a74c26ec43.tar.gz
xen-0a9b2d786bbda43e056ae835dba758a74c26ec43.tar.bz2
xen-0a9b2d786bbda43e056ae835dba758a74c26ec43.zip
stubdom: fix using minios frontends directly when libc is actived
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/netfront.c')
-rw-r--r--extras/mini-os/netfront.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/extras/mini-os/netfront.c b/extras/mini-os/netfront.c
index 4feb0cc4a0..00f159c332 100644
--- a/extras/mini-os/netfront.c
+++ b/extras/mini-os/netfront.c
@@ -259,7 +259,8 @@ void netfront_select_handler(evtchn_port_t port, struct pt_regs *regs, void *dat
network_tx_buf_gc(dev);
local_irq_restore(flags);
- files[fd].read = 1;
+ if (fd != -1)
+ files[fd].read = 1;
wake_up(&netfront_queue);
}
#endif
@@ -323,6 +324,9 @@ struct netfront_dev *init_netfront(char *nodename, void (*thenetif_rx)(unsigned
dev = malloc(sizeof(*dev));
memset(dev, 0, sizeof(*dev));
dev->nodename = strdup(nodename);
+#ifdef HAVE_LIBC
+ dev->fd = -1;
+#endif
printk("net TX ring size %d\n", NET_TX_RING_SIZE);
printk("net RX ring size %d\n", NET_RX_RING_SIZE);
@@ -599,7 +603,7 @@ ssize_t netfront_receive(struct netfront_dev *dev, unsigned char *data, size_t l
local_irq_save(flags);
network_rx(dev);
- if (!dev->rlen)
+ if (!dev->rlen && fd != -1)
/* No data for us, make select stop returning */
files[fd].read = 0;
/* Before re-enabling the interrupts, in case a packet just arrived in the