Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replacing exec(kill) with process.kill. Thanks @visionmedia.

  • Loading branch information...
commit d4a44586d226b437f87f5bbb2ea2a3a25dfc8a52 1 parent 8bb8b27
@vesln authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/watcher.js
View
10 lib/watcher.js
@@ -154,9 +154,13 @@ Watcher.prototype.notify = function(pid, state) {
*/
Watcher.prototype.check = function(pid, cb) {
this.parse(pid, function(p) {
- exec('kill -0 ' + p, function(error, stdout, stderr) {
- cb(!(stderr));
- });
+ var result = false;
+ try {
+ if (p && !process.kill(p, 0)) result = true;
+ } catch (err) {
+ result = false;
+ }
+ cb(result);
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.