Author: mturk
Date: Wed Jul 13 10:07:29 2011
New Revision: 1145942
URL: http://svn.apache.org/viewvc?rev=1145942&view=rev
Log:
Set nonblocking mode if acceptor was blocking or if blocking mode is not
inherited
Modified:
commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c
Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c?rev=1145942&r1=1145941&r2=1145942&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c Wed Jul
13 10:07:29 2011
@@ -365,16 +365,18 @@ ACR_NET_EXPORT(jlong, LocalServerEndpoin
}
}
#endif
-#if !HAVE_NONBLOCK_INHERITED
if (block == JNI_FALSE) {
- int rc = AcrNonblock(sd, 1);
+ int rc = 0;
+#if HAVE_NONBLOCK_INHERITED
+ if ((fd->flags & ACR_DT_NONBLOCK) == 0)
+#endif
+ rc = AcrNonblock(sd, 1);
if (rc != 0) {
r_close(sd);
ACR_THROW_NET_ERROR(rc);
return 0;
}
}
-#endif
#if defined(DEBUG) || defined(_DEBUG)
if (aa.sa.unx.sun_family != AF_LOCAL) {
fprintf(stderr, "Expected AF_LOCAL but found %d\n",
aa.sa.unx.sun_family);