int err = 0;
try {
err = run(cmdline.getCommandline(), r.getOutputStream(), null);
} catch (IOException e) {
try {
r.complete();
log("Redirection of output terminated.", Project.MSG_VERBOSE);
} catch (IOException ex) {
log("Termination of output redirection failed: " + ex, Project.MSG_ERR);
}
throw new BuildException(e, getLocation());