Merge "Use java.lang.Process.pid() to get the PID of a process in Vogar."
am: 9a5664b6ed

Change-Id: I3daf36014b022581b2080292c4e2b7fdf523d510
diff --git a/src/vogar/commands/Command.java b/src/vogar/commands/Command.java
index 10b46c3..dbd4daf 100644
--- a/src/vogar/commands/Command.java
+++ b/src/vogar/commands/Command.java
@@ -219,21 +219,7 @@
 
     private void sendQuitSignal(Process process) {
         // TODO: 'adb shell kill' to kill on processes running on Androids
-        new Command(log, "kill", "-3", Integer.toString(getPid(process))).execute();
-    }
-
-    /**
-     * Return the PID of this command's process.
-     */
-    private int getPid(Process process) {
-        try {
-            // See org.openqa.selenium.ProcessUtils.getProcessId()
-            Field field = process.getClass().getDeclaredField("pid");
-            field.setAccessible(true);
-            return (Integer) field.get(process);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+        new Command(log, "kill", "-3", Long.toString(process.pid())).execute();
     }
 
     public boolean timedOut() {