mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Fix commands getting stuck on start failure
This commit is contained in:
parent
700f539dfb
commit
67b2a7957f
3 changed files with 3 additions and 18 deletions
|
@ -1,15 +0,0 @@
|
|||
package io.xpipe.core.process;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class BufferedProcessInputStream extends BufferedInputStream {
|
||||
|
||||
public BufferedProcessInputStream(InputStream in, int size) {
|
||||
super(in, size);
|
||||
}
|
||||
|
||||
public int bufferedAvailable() {
|
||||
return count - pos;
|
||||
}
|
||||
}
|
|
@ -93,7 +93,7 @@ public interface CommandControl extends ProcessControl {
|
|||
discardOrThrow();
|
||||
return true;
|
||||
} catch (ProcessOutputException ex) {
|
||||
if (ex.isTimeOut()) {
|
||||
if (ex.isIrregularExit()) {
|
||||
throw ex;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,8 @@ public class ProcessOutputException extends Exception {
|
|||
this.output = output;
|
||||
}
|
||||
|
||||
public boolean isTimeOut() {
|
||||
return exitCode == CommandControl.EXIT_TIMEOUT_EXIT_CODE;
|
||||
public boolean isIrregularExit() {
|
||||
return exitCode == CommandControl.EXIT_TIMEOUT_EXIT_CODE || exitCode == CommandControl.START_FAILED_EXIT_CODE || exitCode == CommandControl.UNASSIGNED_EXIT_CODE || exitCode == CommandControl.INTERNAL_ERROR_EXIT_CODE;
|
||||
}
|
||||
|
||||
public boolean isKill() {
|
||||
|
|
Loading…
Reference in a new issue