RootShell: stop if we can't start
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
23c09eb655
commit
643b698f30
@ -112,6 +112,7 @@ public class RootShell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void start() throws IOException, NoRootException {
|
public synchronized void start() throws IOException, NoRootException {
|
||||||
|
try {
|
||||||
if (isRunning())
|
if (isRunning())
|
||||||
return;
|
return;
|
||||||
if (!localBinaryDir.isDirectory() && !localBinaryDir.mkdirs())
|
if (!localBinaryDir.isDirectory() && !localBinaryDir.mkdirs())
|
||||||
@ -145,6 +146,10 @@ public class RootShell {
|
|||||||
}
|
}
|
||||||
throw new IOException("Shell failed to start: " + process.exitValue());
|
throw new IOException("Shell failed to start: " + process.exitValue());
|
||||||
}
|
}
|
||||||
|
} catch (final IOException | NoRootException e) {
|
||||||
|
stop();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void stop() throws IOException {
|
public synchronized void stop() throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user