Automatically close FSWatcher on error

Closes #3250
This commit is contained in:
Bert Belder 2012-05-12 19:37:33 +02:00
parent 5f9ffa17b1
commit d8351a2ef4

View File

@ -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);