[FIXED JENKINS-26476] Work around Remoting problem by avoiding reference to Functions.

This commit is contained in:
Jesse Glick committed 2015-01-16 14:24:52 -05:00
1 parent c8806c9906
commit 36bce39ff4
1 file changed
+4 -1
+4 -1
View File
@@ -1581,6 +1581,7 @@ public final class FilePath implements Serializable {
act(new SecureFileCallable<Void>() {
private static final long serialVersionUID = 1L;
public Void invoke(File f, VirtualChannel channel) throws IOException {
// TODO first check for Java 7+ and use PosixFileAttributeView
_chmod(writing(f), mask);
return null;
@@ -1592,7 +1593,9 @@ public final class FilePath implements Serializable {
* Run chmod via jnr-posix
*/
private static void _chmod(File f, int mask) throws IOException {
if (Functions.isWindows()) return; // noop
// TODO WindowsPosix actually does something here (WindowsLibC._wchmod); should we let it?
// Anyway the existing calls already skip this method if on Windows.
if (File.pathSeparatorChar==';') return; // noop
PosixAPI.jnr().chmod(f.getAbsolutePath(),mask);
}