changeset 316:ca48d7cc3579

6670408: testcase panics 1.5.0_12&_14 JVM when java.net.PlainSocketImpl trying to throw an exception Summary: Replace select with poll Reviewed-by: alanb, jccollet
author chegar
date Thu, 15 May 2008 10:26:07 +0100
parents 61a7e1919ba3
children 49f02cbe27b1
files src/solaris/native/java/net/PlainSocketImpl.c
diffstat 1 files changed, 20 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/PlainSocketImpl.c	Sun May 11 00:26:16 2008 -0700
+++ b/src/solaris/native/java/net/PlainSocketImpl.c	Thu May 15 10:26:07 2008 +0100
@@ -358,15 +358,28 @@
              * See 6343810.
              */
             while (1) {
-                fd_set wr, ex;
+#ifndef USE_SELECT
+                {
+fprintf(stdout,"\nNATIVE: fd = %d] ", fd);
+                    struct pollfd pfd;
+                    pfd.fd = fd;
+                    pfd.events = POLLOUT;
 
-                FD_ZERO(&wr);
-                FD_SET(fd, &wr);
-                FD_ZERO(&ex);
-                FD_SET(fd, &ex);
+                    connect_rv = NET_Poll(&pfd, 1, -1);
+                }
+#else
+                {
+                    fd_set wr, ex;
 
-                errno = 0;
-                connect_rv = NET_Select(fd+1, 0, &wr, &ex, 0);
+                    FD_ZERO(&wr);
+                    FD_SET(fd, &wr);
+                    FD_ZERO(&ex);
+                    FD_SET(fd, &ex);
+
+                    connect_rv = NET_Select(fd+1, 0, &wr, &ex, 0);
+                }
+#endif
+
                 if (connect_rv == JVM_IO_ERR) {
                     if (errno == EINTR) {
                         continue;