[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] stubdom: Add support for select() call with NULL arguments.
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1205839603 0 # Node ID 312053c2da89204f9e1637373be0ee38cad4e1b3 # Parent 1eae3adc5bf7e9cfcf0cf363bf553bc075ec7390 stubdom: Add support for select() call with NULL arguments. Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx> --- extras/mini-os/lib/sys.c | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff -r 1eae3adc5bf7 -r 312053c2da89 extras/mini-os/lib/sys.c --- a/extras/mini-os/lib/sys.c Tue Mar 18 11:26:21 2008 +0000 +++ b/extras/mini-os/lib/sys.c Tue Mar 18 11:26:43 2008 +0000 @@ -837,9 +837,19 @@ int select(int nfds, fd_set *readfds, fd add_waiter(w4, xenbus_watch_queue); add_waiter(w5, kbdfront_queue); - myread = *readfds; - mywrite = *writefds; - myexcept = *exceptfds; + if (readfds) + myread = *readfds; + else + FD_ZERO(&myread); + if (writefds) + mywrite = *writefds; + else + FD_ZERO(&mywrite); + if (exceptfds) + myexcept = *exceptfds; + else + FD_ZERO(&myexcept); + DEBUG("polling "); dump_set(nfds, &myread, &mywrite, &myexcept, timeout); DEBUG("\n"); @@ -878,9 +888,19 @@ int select(int nfds, fd_set *readfds, fd thread->wakeup_time = stop; schedule(); - myread = *readfds; - mywrite = *writefds; - myexcept = *exceptfds; + if (readfds) + myread = *readfds; + else + FD_ZERO(&myread); + if (writefds) + mywrite = *writefds; + else + FD_ZERO(&mywrite); + if (exceptfds) + myexcept = *exceptfds; + else + FD_ZERO(&myexcept); + n = select_poll(nfds, &myread, &mywrite, &myexcept); if (n) { _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |