Skip to content
Permalink
Browse files
8274750: java/io/File/GetXSpace.java failed: '/dev': 191488 != 190976
Backport-of: 13265f9901ab8334bbe1e7a571a9c5f386275dbf
  • Loading branch information
GoeLin committed Feb 8, 2022
1 parent bda9cb4 commit 0965996c5c6d63051f0711c40843c030771a2d7b
Showing 1 changed file with 4 additions and 3 deletions.
@@ -51,6 +51,7 @@
import static java.lang.System.err;
import static java.lang.System.out;

@SuppressWarnings("removal")
public class GetXSpace {

private static SecurityManager [] sma = { null, new Allow(), new DenyFSA(),
@@ -213,8 +214,9 @@ private static void compare(Space s) {
out.format(fmt, "df", s.total(), 0, s.free());
out.format(fmt, "getX", ts, fs, us);

// if the file system can dynamically change size, this check will fail
if (ts != s.total()) {
// If the file system can dynamically change size, this check will fail.
// This can happen on macOS for the /dev files system.
if (ts != s.total() && (!Platform.isOSX() || !s.name().equals("/dev"))) {
long blockSize = 1;
long numBlocks = 0;
try {
@@ -231,7 +233,6 @@ private static void compare(Space s) {
throw new RuntimeException(e);
}


// On macOS, the number of 1024 byte blocks might be incorrectly
// calculated by 'df' using integer division by 2 of the number of
// 512 byte blocks, resulting in a size smaller than the actual

1 comment on commit 0965996

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 0965996 Feb 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.