Index: /trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c
===================================================================
--- /trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c	(revision 19795)
+++ /trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c	(revision 19796)
@@ -349,4 +349,5 @@
                  */
                 PRInt32 fd;
+                int ret;
 
                 printf("Entering event loop, PowerOff the machine to exit or press Ctrl-C to terminate\n");
@@ -359,10 +360,19 @@
                     while (!g_fStop)
                     {
-                        struct pollfd   pfd;
+                        struct pollfd pfd;
+
                         pfd.fd = fd;
                         pfd.events = POLLIN | POLLERR | POLLHUP;
                         pfd.revents = 0;
-                        poll(&pfd, 1, 250);
-                        rc = queue->vtbl->ProcessPendingEvents(queue);
+
+                        ret = poll(&pfd, 1, 250);
+
+                        if (ret <= 0)
+                            continue;
+
+                        if (pfd.revents & POLLHUP)
+                            g_fStop = 1;
+
+                        queue->vtbl->ProcessPendingEvents(queue);
                     }
                 }
