RootShell: stop if we can't start

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-01-09 08:39:07 -06:00
committed by Samuel Holland
parent 23c09eb655
commit 643b698f30
@@ -112,6 +112,7 @@ public class RootShell {
}
public synchronized void start() throws IOException, NoRootException {
try {
if (isRunning())
return;
if (!localBinaryDir.isDirectory() && !localBinaryDir.mkdirs())
@@ -145,6 +146,10 @@ public class RootShell {
}
throw new IOException("Shell failed to start: " + process.exitValue());
}
} catch (final IOException | NoRootException e) {
stop();
throw e;
}
}
public synchronized void stop() throws IOException {