mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-02 22:55:53 +00:00
[HUDSON-8155] handled NoClassDefFoundError
This commit is contained in:
1 parent
972a8cfe4f
commit
c490e884bc
1 file changed
+16
-10
@@ -1098,19 +1098,25 @@ public final class FilePath implements Serializable {
|
||||
if(LIBC.chmod(f.getAbsolutePath(),mask)!=0) {
|
||||
throw new IOException("Failed to chmod "+f+" : "+LIBC.strerror(Native.getLastError()));
|
||||
}
|
||||
} catch(UnsatisfiedLinkError e) { // 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.");
|
||||
}
|
||||
Chmod chmodTask = new Chmod();
|
||||
chmodTask.setProject(new Project());
|
||||
chmodTask.setFile(f);
|
||||
chmodTask.setPerm(Integer.toOctalString(mask));
|
||||
chmodTask.execute();
|
||||
} catch(NoClassDefFoundError e) { // cf. https://groups.google.com/group/hudson-dev/browse_thread/thread/6d16c3e8ea0dbc9?hl=fr
|
||||
_chmodAnt(f, mask);
|
||||
} catch(UnsatisfiedLinkError e2) { // HUDSON-8155: use Ant's chmod task on non-GNU C systems
|
||||
_chmodAnt(f, mask);
|
||||
}
|
||||
}
|
||||
|
||||
private static void _chmodAnt(File f, int mask) {
|
||||
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.");
|
||||
}
|
||||
Chmod chmodTask = new Chmod();
|
||||
chmodTask.setProject(new Project());
|
||||
chmodTask.setFile(f);
|
||||
chmodTask.setPerm(Integer.toOctalString(mask));
|
||||
chmodTask.execute();
|
||||
}
|
||||
|
||||
private static boolean CHMOD_WARNED = false;
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user