From 0666a470e7b40dce4045a107f464e5327f4cbd2c Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sat, 12 Dec 2009 00:00:16 +0000 Subject: [PATCH] bug fix git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24575 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/Util.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 16eed1aafc..2ec33cf57f 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -1014,9 +1014,10 @@ public class Util { Memory m = new Memory(sz); int r = GNUCLibrary.LIBC.readlink(filename,m,new NativeLong(sz)); if (r<0) { - if (r==22/*EINVAL --- but is this really portable?*/) + int err = Native.getLastError(); + if (err==22/*EINVAL --- but is this really portable?*/) return null; // this means it's not a symlink - throw new IOException("Failed to readlink "+link+" error="+Native.getLastError()); + throw new IOException("Failed to readlink "+link+" error="+ err); } if (r==sz) continue; // buffer too small