Skip to content

Commit

Permalink
[FIXED JENKINS-26476] Work around Remoting problem by avoiding refere…
Browse files Browse the repository at this point in the history
…nce to Functions.
  • Loading branch information
jglick committed Jan 16, 2015
1 parent c8806c9 commit 36bce39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/FilePath.java
Expand Up @@ -1581,6 +1581,7 @@ public void chmod(final int mask) throws IOException, InterruptedException {
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;
Expand All @@ -1592,7 +1593,9 @@ public Void invoke(File f, VirtualChannel channel) throws IOException {
* 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);
}
Expand Down

0 comments on commit 36bce39

Please sign in to comment.