< prev index next >
src/java.base/macosx/classes/sun/nio/fs/BsdFileStore.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2008, 2012, 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
--- 1,7 ----
/*
! * 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,85 ****
} catch (UnixException x) {
x.rethrowAsIOException(file());
}
// step 2: find mount point
! UnixPath parent = path.getParent();
! while (parent != null) {
! UnixFileAttributes attrs = null;
try {
! attrs = UnixFileAttributes.get(parent, true);
} catch (UnixException x) {
! x.rethrowAsIOException(parent);
! }
! if (attrs.dev() != dev())
! break;
! path = parent;
! parent = parent.getParent();
}
// step 3: lookup mounted file systems
- byte[] dir = path.asByteArray();
for (UnixMountEntry entry: fs.getMountEntries()) {
if (Arrays.equals(dir, entry.dir()))
return entry;
}
--- 60,77 ----
} catch (UnixException x) {
x.rethrowAsIOException(file());
}
// step 2: find mount point
! byte[] dir = null;
try {
! dir = BsdNativeDispatcher.getmntonname(path);
} catch (UnixException x) {
! x.rethrowAsIOException(path);
}
// step 3: lookup mounted file systems
for (UnixMountEntry entry: fs.getMountEntries()) {
if (Arrays.equals(dir, entry.dir()))
return entry;
}
< prev index next >