< prev index next >
src/java.base/macosx/classes/sun/nio/fs/BsdFileStore.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -60,26 +60,18 @@
} catch (UnixException x) {
x.rethrowAsIOException(file());
}
// step 2: find mount point
- UnixPath parent = path.getParent();
- while (parent != null) {
- UnixFileAttributes attrs = null;
+ byte[] dir = null;
try {
- attrs = UnixFileAttributes.get(parent, true);
+ dir = BsdNativeDispatcher.getmntonname(path);
} catch (UnixException x) {
- x.rethrowAsIOException(parent);
- }
- if (attrs.dev() != dev())
- break;
- path = parent;
- parent = parent.getParent();
+ x.rethrowAsIOException(path);
}
// step 3: lookup mounted file systems
- byte[] dir = path.asByteArray();
for (UnixMountEntry entry: fs.getMountEntries()) {
if (Arrays.equals(dir, entry.dir()))
return entry;
}
< prev index next >