]> go.fuhry.dev Git - fsnotify.git/commitdiff
Renamed two misnamed things
authorPieter Droogendijk <pieter@binky.org.uk>
Sat, 7 Feb 2015 23:08:01 +0000 (00:08 +0100)
committerNathan Youngman <git@nathany.com>
Sun, 8 Feb 2015 20:22:31 +0000 (13:22 -0700)
inotify.go
inotify_poller_test.go

index 5aa185b88dfeebdc87891b8982f40ddb4a7abf29..4198c3e66bb44901a9443c0aac2cf03ff268016a 100644 (file)
@@ -28,7 +28,7 @@ type Watcher struct {
        watches  map[string]*watch // Map of inotify watches (key: path)
        paths    map[int]string    // Map of watched paths (key: watch descriptor)
        done     chan struct{}     // Channel for sending a "quit message" to the reader goroutine
-       doneresp chan struct{}     // Channel to respond to Close
+       doneResp chan struct{}     // Channel to respond to Close
 }
 
 // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events.
@@ -52,7 +52,7 @@ func NewWatcher() (*Watcher, error) {
                Events:   make(chan Event),
                Errors:   make(chan error),
                done:     make(chan struct{}),
-               doneresp: make(chan struct{}),
+               doneResp: make(chan struct{}),
        }
 
        go w.readEvents()
@@ -81,7 +81,7 @@ func (w *Watcher) Close() error {
        w.poller.wake()
 
        // Wait for goroutine to close
-       <-w.doneresp
+       <-w.doneResp
 
        return nil
 }
@@ -155,7 +155,7 @@ func (w *Watcher) readEvents() {
                ok    bool                                    // For poller.wait
        )
 
-       defer close(w.doneresp)
+       defer close(w.doneResp)
        defer close(w.Errors)
        defer close(w.Events)
        defer syscall.Close(w.fd)
index 3625eab3c30d32722acf11d022a763856e0f1fd7..83176585edc916781d6826f984a52a7a621058e3 100644 (file)
@@ -163,8 +163,8 @@ func TestPollerConcurrent(t *testing.T) {
        defer poller.close()
 
        oks := make(chan bool)
-       kill := make(chan bool)
-       defer close(kill)
+       live := make(chan bool)
+       defer close(live)
        go func() {
                defer close(oks)
                for {
@@ -173,7 +173,7 @@ func TestPollerConcurrent(t *testing.T) {
                                t.Fatalf("poller failed: %v", err)
                        }
                        oks <- ok
-                       if !<-kill {
+                       if !<-live {
                                return
                        }
                }
@@ -190,7 +190,7 @@ func TestPollerConcurrent(t *testing.T) {
                t.Fatalf("expected true")
        }
        tfd.get(t)
-       kill <- true
+       live <- true
 
        // Try a wakeup
        select {
@@ -205,7 +205,7 @@ func TestPollerConcurrent(t *testing.T) {
        if <-oks {
                t.Fatalf("expected false")
        }
-       kill <- true
+       live <- true
 
        // Try a close
        select {