Lines 23566-23571
Link Here
|
23566 |
len = sizeof(struct sockaddr_in); |
23566 |
len = sizeof(struct sockaddr_in); |
23567 |
} |
23567 |
} |
23568 |
JVM_Connect(fd, (struct sockaddr *)&addr, len); |
23568 |
JVM_Connect(fd, (struct sockaddr *)&addr, len); |
|
|
23569 |
--- jdk/src/solaris/native/java/net/bsd_close.c.orig 2012-08-10 17:31:31.000000000 +0000 |
23570 |
+++ jdk/src/solaris/native/java/net/bsd_close.c 2013-01-18 18:36:37.000000000 +0000 |
23571 |
@@ -29,7 +29,6 @@ |
23572 |
#include <pthread.h> |
23573 |
#include <sys/types.h> |
23574 |
#include <sys/socket.h> |
23575 |
-#include <sys/select.h> |
23576 |
#include <sys/time.h> |
23577 |
#include <sys/resource.h> |
23578 |
#include <sys/uio.h> |
23579 |
@@ -340,13 +339,13 @@ |
23580 |
#endif |
23581 |
|
23582 |
/* |
23583 |
- * Wrapper for select(s, timeout). We are using select() on Mac OS due to Bug 7131399. |
23584 |
+ * Wrapper for poll(s, timeout). |
23585 |
* Auto restarts with adjusted timeout if interrupted by |
23586 |
* signal other than our wakeup signal. |
23587 |
*/ |
23588 |
int NET_Timeout(int s, long timeout) { |
23589 |
long prevtime = 0, newtime; |
23590 |
- struct timeval t, *tp = &t; |
23591 |
+ struct timeval t; |
23592 |
fdEntry_t *fdEntry = getFdEntry(s); |
23593 |
|
23594 |
/* |
23595 |
@@ -361,35 +360,24 @@ |
23596 |
* Pick up current time as may need to adjust timeout |
23597 |
*/ |
23598 |
if (timeout > 0) { |
23599 |
- /* Timed */ |
23600 |
- struct timeval now; |
23601 |
- gettimeofday(&now, NULL); |
23602 |
- prevtime = now.tv_sec * 1000 + now.tv_usec / 1000; |
23603 |
- t.tv_sec = timeout / 1000; |
23604 |
- t.tv_usec = (timeout % 1000) * 1000; |
23605 |
- } else if (timeout < 0) { |
23606 |
- /* Blocking */ |
23607 |
- tp = 0; |
23608 |
- } else { |
23609 |
- /* Poll */ |
23610 |
- t.tv_sec = 0; |
23611 |
- t.tv_usec = 0; |
23612 |
+ gettimeofday(&t, NULL); |
23613 |
+ prevtime = t.tv_sec * 1000 + t.tv_usec / 1000; |
23614 |
} |
23615 |
|
23616 |
for(;;) { |
23617 |
- fd_set rfds; |
23618 |
+ struct pollfd pfd; |
23619 |
int rv; |
23620 |
threadEntry_t self; |
23621 |
|
23622 |
/* |
23623 |
- * call select on the fd. If interrupted by our wakeup signal |
23624 |
+ * Poll the fd. If interrupted by our wakeup signal |
23625 |
* errno will be set to EBADF. |
23626 |
*/ |
23627 |
- FD_ZERO(&rfds); |
23628 |
- FD_SET(s, &rfds); |
23629 |
+ pfd.fd = s; |
23630 |
+ pfd.events = POLLIN | POLLERR; |
23631 |
|
23632 |
startOp(fdEntry, &self); |
23633 |
- rv = select(s+1, &rfds, 0, 0, tp); |
23634 |
+ rv = poll(&pfd, 1, timeout); |
23635 |
endOp(fdEntry, &self); |
23636 |
|
23637 |
/* |
23638 |
@@ -398,16 +386,13 @@ |
23639 |
*/ |
23640 |
if (rv < 0 && errno == EINTR) { |
23641 |
if (timeout > 0) { |
23642 |
- struct timeval now; |
23643 |
- gettimeofday(&now, NULL); |
23644 |
- newtime = now.tv_sec * 1000 + now.tv_usec / 1000; |
23645 |
+ gettimeofday(&t, NULL); |
23646 |
+ newtime = t.tv_sec * 1000 + t.tv_usec / 1000; |
23647 |
timeout -= newtime - prevtime; |
23648 |
if (timeout <= 0) { |
23649 |
return 0; |
23650 |
} |
23651 |
prevtime = newtime; |
23652 |
- t.tv_sec = timeout / 1000; |
23653 |
- t.tv_usec = (timeout % 1000) * 1000; |
23654 |
} |
23655 |
} else { |
23656 |
return rv; |
23569 |
--- jdk/src/solaris/native/java/net/net_util_md.c 2012-08-10 10:31:31.000000000 -0700 |
23657 |
--- jdk/src/solaris/native/java/net/net_util_md.c 2012-08-10 10:31:31.000000000 -0700 |
23570 |
+++ jdk/src/solaris/native/java/net/net_util_md.c 2013-01-16 08:58:15.000000000 -0800 |
23658 |
+++ jdk/src/solaris/native/java/net/net_util_md.c 2013-01-16 08:58:15.000000000 -0800 |
23571 |
@@ -45,6 +45,10 @@ |
23659 |
@@ -45,6 +45,10 @@ |