Permalink
Browse files

handle cases where there is no child prcess

  • Loading branch information...
1 parent a155697 commit 4cc05ee77cb9a665b207742a864fb912c61f954f @haircuttedfreak haircuttedfreak committed Aug 13, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 nodemon.js
View
@@ -364,8 +364,13 @@ function killNode() {
// Force kill (/F) the whole child tree (/T) by PID (/PID 123)
exec('taskkill /pid '+child.pid+' /T /F');
} else {
- killedAfterChange = true;
- exec('pkill -P ' + child.pid );
+ killedAfterChange = true;
+ exec('pkill -P ' + child.pid, function (error, stdout, stderr) {
+ if (error !== null) {
+ killedAfterChange = false;
+ child.kill('SIGUSR2');
+ }
+ });
}
} else {
startNode();

0 comments on commit 4cc05ee

Please sign in to comment.