thrownewIOException("Failed to chmod "+f+" : "+LIBC.strerror(Native.getLastError()));
}
}catch(UnsatisfiedLinkErrore){// HUDSON-8155: use Ant's chmod task on non-GNU C systems
if(!CHMOD_WARNED){// only warn this once to avoid flooding the log
CHMOD_WARNED=true;
LOGGER.warning("GNU C Library not available: Using Ant's chmod task instead.");
}
ChmodchmodTask=newChmod();
chmodTask.setProject(newProject());
chmodTask.setFile(f);
chmodTask.setPerm(Integer.toOctalString(mask));
chmodTask.execute();
}
}
privatestaticbooleanCHMOD_WARNED=false;
/**
* Gets the file permission bit mask.
*
...
...
@@ -1566,11 +1594,7 @@ public final class FilePath implements Serializable {
f.setLastModified(te.getModTime().getTime());
intmode=te.getMode()&0777;
if(mode!=0&&!Functions.isWindows())// be defensive
try{
LIBC.chmod(f.getPath(),mode);
}catch(NoClassDefFoundErrore){
// be defensive. see http://www.nabble.com/-3.0.6--Site-copy-problem%3A-hudson.util.IOException2%3A--java.lang.NoClassDefFoundError%3A-Could-not-initialize-class--hudson.util.jna.GNUCLibrary-td23588879.html
}
_chmod(f,mode);
}
}
}catch(IOExceptione){
...
...
@@ -1877,6 +1901,8 @@ public final class FilePath implements Serializable {