Permalink
Browse files

typo. Report the success appropriately from piped subprocs

  • Loading branch information...
1 parent f0948d1 commit 38266d93b6d45e4f0e1332492a6b97d1cdf80d09 @isaacs isaacs committed Jan 30, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/utils/exec.js
View
@@ -37,14 +37,14 @@ function pipe (cp1, cp2, cb) {
cp2.stderr.on("data", logger)
}
cp1.on("exit", function (code) {
- if (!code) return log.verbose(cp2.name || "<unknown>", "success")
+ if (!code) return log.verbose(cp1.name || "<unknown>", "success")
cp2.kill()
cb(errState = new Error(
"Failed "+(cp1.name || "<unknown>")+"\nexited with "+code))
})
cp2.on("exit", function (code) {
if (errState) return
- if (!code) return log.verbose(cp1.name || "<unknown>", "success", cb)
+ if (!code) return log.verbose(cp2.name || "<unknown>", "success", cb)
cb(new Error( "Failed "+(cp2.name || "<unknown>")+"\nexited with "+code))
})
}

0 comments on commit 38266d9

Please sign in to comment.