Permalink
Browse files

ensure dtrace stderr is piped through

  • Loading branch information...
1 parent d133def commit 44fc428a8aa882be4e28cad11672a1169a292ae9 @trentm committed Nov 2, 2012
Showing with 7 additions and 2 deletions.
  1. +3 −1 CHANGES.md
  2. +4 −1 bin/bunyan
View
@@ -2,7 +2,9 @@
## bunyan 0.16.2 (not yet released)
-(nothing yet)
+- Ensure that stderr from the dtrace child process (when using `bunyan -p PID`)
+ gets through. The `pipe` usage wasn't working on SmartOS. This is important
+ to show the user if they need to 'sudo'.
## bunyan 0.16.1
View
@@ -910,7 +910,10 @@ function processPid(opts, stylize, callback) {
var dtrace = spawn(argv[0], argv.slice(1));
child = dtrace; // intentionall global
- dtrace.stderr.pipe(process.stderr);
+ dtrace.stderr.setEncoding('utf8');
+ dtrace.stderr.on('data', function (chunk) {
+ process.stderr.write(chunk);
+ });
dtrace.stdout.setEncoding('utf8');
dtrace.stdout.on('data', function (chunk) {

0 comments on commit 44fc428

Please sign in to comment.