Browse Source

when running windows bat script, the handle is invalid in win7 (#2269)

pull/2/head
liwenhe1993 5 years ago committed by GitHub
parent
commit
34e2f67e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/process/ProcessImplForWin32.java

5
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/process/ProcessImplForWin32.java

@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static com.sun.jna.platform.win32.WinBase.INVALID_HANDLE_VALUE;
import static com.sun.jna.platform.win32.WinBase.STILL_ACTIVE; import static com.sun.jna.platform.win32.WinBase.STILL_ACTIVE;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
@ -742,7 +743,9 @@ public class ProcessImplForWin32 extends Process {
} }
private static void closeHandle(WinNT.HANDLE handle) { private static void closeHandle(WinNT.HANDLE handle) {
Kernel32Util.closeHandle(handle); if (!handle.equals(INVALID_HANDLE_VALUE)) {
Kernel32Util.closeHandle(handle);
}
} }
/** /**

Loading…
Cancel
Save