2238N/A#
2362N/A# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2238N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2238N/A#
2238N/A# This code is free software; you can redistribute it and/or modify it
2238N/A# under the terms of the GNU General Public License version 2 only, as
2238N/A# published by the Free Software Foundation.
2238N/A#
2238N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2238N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2238N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2238N/A# version 2 for more details (a copy is included in the LICENSE file that
2238N/A# accompanied this code).
2238N/A#
2238N/A# You should have received a copy of the GNU General Public License version
2238N/A# 2 along with this work; if not, write to the Free Software Foundation,
2238N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2238N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
2238N/A#
2238N/A
2238N/A# @test
2238N/A# @bug 6368984
2238N/A# @summary configuring unconnected Socket before passing to implAccept can cause fd leak
2238N/A# @build AcceptCauseFileDescriptorLeak
2238N/A# @run shell AcceptCauseFileDescriptorLeak.sh
2238N/A
2238N/AOS=`uname -s`
2238N/Acase "$OS" in
2238N/A Windows_* | CYGWIN* )
2238N/A echo "ulimit not on Windows"
2238N/A exit 0
2238N/A ;;
2238N/A * )
2238N/A CLASSPATH=${TESTCLASSES}:${TESTSRC}
2238N/A ;;
2238N/Aesac
2238N/Aexport CLASSPATH
2238N/A
2238N/A# hard limit needs to be less than 1024 for this bug
2238N/ANOFILES=`ulimit -n -H`
2238N/Aif [ "$NOFILES" = "unlimited" ] || [ $NOFILES -ge 1024 ]; then
2238N/A ulimit -n 1024
2238N/Afi
2238N/A
2238N/A${TESTJAVA}/bin/java AcceptCauseFileDescriptorLeak