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.
(cherry picked from commit a016f3d)

Conflicts:
	changelog.html
  • Loading branch information
kohsuke authored and vjuranek committed Apr 14, 2013
1 parent 3aaca05 commit 606dea7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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 606dea7

Please sign in to comment.