Skip to content

Commit

Permalink
[FIXED JENKINS-17343]
Browse files Browse the repository at this point in the history
Don't break Windows XP, fall back gracefully to no-op.
  • Loading branch information
kohsuke committed Apr 2, 2013
1 parent 8aa9122 commit a016f3d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -63,6 +63,9 @@
<div id="rc" style="display:none;"><!--=BEGIN=-->
<h3><a name=v1.510>What's new in 1.510</a> <!--=DATE=--></h3>
<ul class=image>
<li class=bug>
<tt>UnsatisfiedLinkError</tt> on <tt>CreateSymbolicLinkw</tt> on Windows XP.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17343">issue 17343</a>)
<li class=bug>
Flyweight tasks should execute on the master if there's no static
executors available.
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/Util.java
Expand Up @@ -1065,6 +1065,9 @@ public static void createSymlink(File baseDir, String targetPath, String symlink
return;
}
throw e;
} catch (UnsatisfiedLinkError e) {
// not available on this Windows
return;
}
} else {
String errmsg = "";
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/util/jna/Kernel32Utils.java
Expand Up @@ -80,6 +80,10 @@ public static int getWin32FileAttributes(File file) throws IOException {
* @param target
* If relative, resolved against the location of the symlink.
* If absolute, it's absolute.
* @throws UnsatisfiedLinkError
* If the function is not exported by kernel32.
* See http://msdn.microsoft.com/en-us/library/windows/desktop/aa363866(v=vs.85).aspx
* for compatibility info.
*/
public static void createSymbolicLink(File symlink, String target, boolean dirLink) throws IOException {
if (!Kernel32.INSTANCE.CreateSymbolicLinkW(
Expand Down

0 comments on commit a016f3d

Please sign in to comment.