From c3b473e4bc4079ee2b77e4044286c83f2672e3f2 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 7 Jul 2018 17:48:05 +0800 Subject: [PATCH] Fix get_outfd in embedded mode --- scripts/util_functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 706755173..422d8b5fa 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -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