Skip to content

Commit c7e778e

Browse files
committed
I am an idiot.
1 parent 61d0837 commit c7e778e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

platform/src/main/java/co/casterlabs/commons/platform/LinuxLibC.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package co.casterlabs.commons.platform;
22

3+
import java.io.File;
4+
import java.io.FileInputStream;
35
import java.io.IOException;
46
import java.nio.charset.StandardCharsets;
5-
import java.nio.file.Files;
6-
import java.nio.file.Path;
77

88
/**
99
* This class allows you to detect whether or not a machine uses GNU or MUSL
@@ -42,8 +42,10 @@ public static boolean isGNU() throws IOException {
4242
}
4343

4444
private static boolean isGNUViaFS() throws IOException {
45-
String ldd = Files.readString(Path.of("/usr/bin/ldd"));
46-
return ldd.contains("GNU C Library");
45+
try (FileInputStream fin = new FileInputStream(new File("/usr/bin/ldd"))) {
46+
String ldd = _PlatformUtil.readInputStreamString(fin, StandardCharsets.UTF_8);
47+
return ldd.contains("GNU C Library");
48+
}
4749
}
4850

4951
private static boolean isGNUViaCommand() throws IOException {

0 commit comments

Comments
 (0)