Skip to content

Commit

Permalink
[FIXED JENKINS-13202] fixed a regression in untar on exotic platforms.
Browse files Browse the repository at this point in the history
Fall back in non-JNA case wasn't working.
  • Loading branch information
kohsuke committed May 23, 2012
1 parent 70ee74c commit 95c1728
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Fixed a regression in untar operation in exotic platforms
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13202">issue 13202</a>)
<li class=bug>
Fixed a possible race condition
<li class=bug>
Expand Down
25 changes: 14 additions & 11 deletions core/src/main/java/hudson/os/PosixAPI.java
Expand Up @@ -9,6 +9,7 @@
import java.io.File;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Map;
import java.util.logging.Logger;

/**
Expand Down Expand Up @@ -55,33 +56,35 @@ public boolean isVerbose() {
}

public File getCurrentWorkingDirectory() {
// TODO
throw new UnsupportedOperationException();
return new File(".").getAbsoluteFile();
}

public String[] getEnv() {
// TODO
throw new UnsupportedOperationException();
Map<String,String> envs = System.getenv();
String[] envp = new String[envs.size()];

int i = 0;
for (Map.Entry<String,String> e : envs.entrySet()) {
envp[i++] = e.getKey()+'+'+e.getValue();
}
return envp;
}

public InputStream getInputStream() {
// TODO
throw new UnsupportedOperationException();
return System.in;
}

public PrintStream getOutputStream() {
// TODO
throw new UnsupportedOperationException();
return System.out;
}

public int getPID() {
// TODO
throw new UnsupportedOperationException();
return 0;
}

public PrintStream getErrorStream() {
// TODO
throw new UnsupportedOperationException();
return System.err;
}
}, true);

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/util/DirScanner.java
Expand Up @@ -112,7 +112,7 @@ public void scan(File dir, FileVisitor visitor) throws IOException {

if (visitor.understandsSymlink()) {
try {
String target = Util.resolveSymlink(file,TaskListener.NULL);
String target = Util.resolveSymlink(file);
if (target!=null) {
visitor.visitSymlink(file,target,f);
continue;
Expand Down

0 comments on commit 95c1728

Please sign in to comment.