Fix get_outfd in embedded mode

This commit is contained in:
topjohnwu 2018-07-07 17:48:05 +08:00
parent 7ed2c077de
commit c3b473e4bc
1 changed files with 3 additions and 3 deletions

View File

@ -23,10 +23,10 @@ BOOTSIGNER="/system/bin/dalvikvm -Xnodex2oat -Xnoimage-dex2oat -cp \$APK com.top
BOOTSIGNED=false
get_outfd() {
if [ -z $OUTFD ] || readlink /proc/self/fd/$OUTFD | grep -q /tmp; then
if [ -z $OUTFD ] || readlink /proc/$$/fd/$OUTFD | grep -q /tmp; then
# We will have to manually find out OUTFD
for FD in `ls /proc/self/fd`; do
if readlink /proc/self/fd/$FD | grep -q pipe; then
for FD in `ls /proc/$$/fd`; do
if readlink /proc/$$/fd/$FD | grep -q pipe; then
if ps | grep -v grep | grep -q " 3 $FD "; then
OUTFD=$FD
break