[tor-commits] [orbot/master] fix code for finding existing processes

n8fr8 at torproject.org n8fr8 at torproject.org
Sun Feb 23 00:27:06 UTC 2014


commit 87411bea855e678fc9835da68076219d49e25c07
Author: Nathan Freitas <nathan at freitas.net>
Date:   Sat Feb 22 19:16:47 2014 -0500

    fix code for finding existing processes
---
 src/org/torproject/android/service/TorServiceUtils.java |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/org/torproject/android/service/TorServiceUtils.java b/src/org/torproject/android/service/TorServiceUtils.java
index fde8c9e..c1f3145 100644
--- a/src/org/torproject/android/service/TorServiceUtils.java
+++ b/src/org/torproject/android/service/TorServiceUtils.java
@@ -91,6 +91,8 @@ public class TorServiceUtils implements TorServiceConstants {
 		    	
 		Process procPs = null;
 		
+		String baseName = new File(command).getName();
+		
         procPs = r.exec(SHELL_CMD_PS);
             
         BufferedReader reader = new BufferedReader(new InputStreamReader(procPs.getInputStream()));
@@ -98,7 +100,7 @@ public class TorServiceUtils implements TorServiceConstants {
         
         while ((line = reader.readLine())!=null)
         {
-        	if (line.indexOf(' ' + command)!=-1)
+        	if (line.indexOf('/' + baseName)!=-1)
         	{
         		
         		StringTokenizer st = new StringTokenizer(line," ");





More information about the tor-commits mailing list