HADOOP-6614. svn merge -c 1204388 from trunk

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1204389 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2011-11-21 08:02:29 +00:00
parent 4d6609a84b
commit 8df7a1f799
2 changed files with 14 additions and 1 deletions

View File

@ -25,6 +25,9 @@ Release 0.23.1 - Unreleased
HADOOP-7787. Make source tarball use conventional name. HADOOP-7787. Make source tarball use conventional name.
(Bruno Mahé via tomwhite) (Bruno Mahé via tomwhite)
HADOOP-6614. RunJar should provide more diags when it can't create
a temp file. (Jonathan Hsieh via eli)
Release 0.23.0 - 2011-11-01 Release 0.23.0 - 2011-11-01
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -149,7 +149,17 @@ public class RunJar {
File tmpDir = new File(new Configuration().get("hadoop.tmp.dir")); File tmpDir = new File(new Configuration().get("hadoop.tmp.dir"));
ensureDirectory(tmpDir); ensureDirectory(tmpDir);
final File workDir = File.createTempFile("hadoop-unjar", "", tmpDir); File workDir;
try {
workDir = File.createTempFile("hadoop-unjar", "", tmpDir);
} catch (IOException ioe) {
// if user has insufficient perms to write to tmpDir, default
// "Permission denied" message doesn't specify a filename.
System.err.println("Error creating temp dir in " + tmpDir + " due to "
+ ioe.getMessage());
System.exit(-1);
}
if (!workDir.delete()) { if (!workDir.delete()) {
System.err.println("Delete failed for " + workDir); System.err.println("Delete failed for " + workDir);
System.exit(-1); System.exit(-1);