changeset 4882:ae08248e0ed0

7162955: Attach api on Solaris, too many open files Summary: Release server-side socket after client receives it. Reviewed-by: sla, dsamersoff, dcubed, acorn Contributed-by: dean.long@oracle.com
author dlong
date Thu, 26 Apr 2012 16:24:15 -0400
parents 39628b02a383
children 202b7ee59b9d
files src/os/solaris/vm/attachListener_solaris.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/solaris/vm/attachListener_solaris.cpp	Fri Mar 23 10:53:19 2012 -0400
+++ b/src/os/solaris/vm/attachListener_solaris.cpp	Thu Apr 26 16:24:15 2012 -0400
@@ -336,7 +336,9 @@
     // Return 0 (success) + file descriptor, or non-0 (error)
     if (res == 0) {
       door_desc_t desc;
-      desc.d_attributes = DOOR_DESCRIPTOR;
+      // DOOR_RELEASE flag makes sure fd is closed after passing it to
+      // the client.  See door_return(3DOOR) man page.
+      desc.d_attributes = DOOR_DESCRIPTOR | DOOR_RELEASE;
       desc.d_data.d_desc.d_descriptor = return_fd;
       door_return((char*)&res, sizeof(res), &desc, 1);
     } else {