From 317b92c31e99721df0b66ea2034b971c2317069f Mon Sep 17 00:00:00 2001 From: Glavo Date: Sat, 24 Jan 2026 20:44:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=20SystemUtils=20(#5315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jackhuang/hmcl/util/platform/SystemUtils.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/SystemUtils.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/SystemUtils.java index 3ea8b867a..6e642be2e 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/SystemUtils.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/SystemUtils.java @@ -81,13 +81,9 @@ public final class SystemUtils { } public static T run(List command, ExceptionalFunction convert) throws Exception { - File nul = OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS - ? new File("NUL") - : new File("/dev/null"); - Process process = new ProcessBuilder(command) - .redirectInput(nul) - .redirectError(nul) + .redirectInput(ProcessBuilder.Redirect.DISCARD) + .redirectError(ProcessBuilder.Redirect.DISCARD) .start(); try { InputStream inputStream = process.getInputStream();