Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes regarding unwatching and rewatching a path #129

Merged
merged 14 commits into from
Oct 4, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
trigger: Check that no watches remain on close
  • Loading branch information
imsodin committed Aug 31, 2017
commit 732152040a151848b3d92e6b25d41b7cf7db9ec3
4 changes: 4 additions & 0 deletions watcher_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package notify

import (
"fmt"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -117,6 +118,9 @@ func (t *trg) Close() (err error) {
dbgprintf("trg: closing native watch failed: %q\n", e)
err = nonil(err, e)
}
if remaining := len(t.pthLkp); remaining != 0 {
err = nonil(err, fmt.Errorf("Not all watches were removed: len(t.pthLkp) == %v", len(t.pthLkp)))
}
t.Unlock()
return
}
Expand Down