WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] stubdom: support select with NULL arguments

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] stubdom: support select with NULL arguments
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Tue, 11 Mar 2008 17:38:09 +0000
Delivery-date: Tue, 11 Mar 2008 11:10:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Add support for select() call with NULL arguments.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r 73ec21ad5dc7 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c  Tue Mar 11 16:01:04 2008 +0000
+++ b/extras/mini-os/lib/sys.c  Tue Mar 11 17:35:14 2008 +0000
@@ -820,9 +820,19 @@
     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");
@@ -861,9 +871,19 @@
        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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] stubdom: support select with NULL arguments, Samuel Thibault <=