--- a/jdk/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java Thu Dec 10 09:23:49 2015 -0800
+++ b/jdk/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java Thu Dec 10 15:57:27 2015 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, 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
@@ -94,22 +94,20 @@
// returns true if extended attributes enabled on file system where given
// file resides, returns false if disabled or unable to determine.
private boolean isExtendedAttributesEnabled(UnixPath path) {
+ int fd = -1;
try {
- int fd = path.openForAttributeAccess(false);
- try {
- // fgetxattr returns size if called with size==0
- byte[] name = Util.toBytes("user.java");
- LinuxNativeDispatcher.fgetxattr(fd, name, 0L, 0);
+ fd = path.openForAttributeAccess(false);
+
+ // fgetxattr returns size if called with size==0
+ byte[] name = Util.toBytes("user.java");
+ LinuxNativeDispatcher.fgetxattr(fd, name, 0L, 0);
+ return true;
+ } catch (UnixException e) {
+ // attribute does not exist
+ if (e.errno() == UnixConstants.ENODATA)
return true;
- } catch (UnixException e) {
- // attribute does not exist
- if (e.errno() == UnixConstants.ENODATA)
- return true;
- } finally {
- UnixNativeDispatcher.close(fd);
- }
- } catch (IOException ignore) {
- // nothing we can do
+ } finally {
+ UnixNativeDispatcher.close(fd);
}
return false;
}