This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Automatically close FSWatcher on error

Closes #3250
  • Loading branch information...
1 parent 5f9ffa1 commit d8351a2ef45756fb3458d3cdf964955e39fe4a76 @piscisaureus piscisaureus committed May 12, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/fs.js
View
@@ -659,6 +659,7 @@ function FSWatcher() {
this._handle.onchange = function(status, event, filename) {
if (status) {
+ self._handle.close();
self.emit('error', errnoException(errno, 'watch'));
} else {
self.emit('change', event, filename);

1 comment on commit d8351a2

Member

bnoordhuis commented on d8351a2 May 13, 2012

Needs a test.

Please sign in to comment.