test/com/sun/tools/attach/ApplicationSetup.sh

Print this page

        

*** 47,65 **** # ${pid} is not the actual pid. We have put in a small sleep # to give the intermediate shell process time to launch the # "java" process. if [ "$OS" = "Windows" ]; then sleep 2 realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` pid=${realpid} fi echo "Waiting for Application to initialize..." attempts=0 while true; do sleep 1 ! port=`tail -1 ${OUTPUTFILE}` if [ ! -z "$port" ]; then # In case of errors wait time for output to be flushed sleep 1 cat ${OUTPUTFILE} break --- 47,69 ---- # ${pid} is not the actual pid. We have put in a small sleep # to give the intermediate shell process time to launch the # "java" process. if [ "$OS" = "Windows" ]; then sleep 2 + if [ "${isCygwin}" = "true" ] ; then + realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'` + else realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` + fi pid=${realpid} fi echo "Waiting for Application to initialize..." attempts=0 while true; do sleep 1 ! port=`tail -1 ${OUTPUTFILE} | sed -e 's@\\r@@g' ` if [ ! -z "$port" ]; then # In case of errors wait time for output to be flushed sleep 1 cat ${OUTPUTFILE} break