Skip to content

Commit

Permalink
Merge pull request #74 from rgooch/update-fsnotify
Browse files Browse the repository at this point in the history
Update to new fsnotify.
  • Loading branch information
rgooch authored Oct 6, 2022
2 parents 3a45a4e + 1d2cc8a commit 2315290
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ module github.com/Cloud-Foundations/Dominator

go 1.19

replace github.com/go-fsnotify/fsnotify v0.0.0-20180321022601-755488143dae => github.com/fsnotify/fsnotify v1.5.1

require (
github.com/Cloud-Foundations/tricorder v0.0.0-20191102180116-cf6bbf6d0168
github.com/aws/aws-sdk-go v1.44.112
github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c
github.com/d2g/dhcp4client v1.0.0
github.com/fsnotify/fsnotify v1.5.1
github.com/krolaw/dhcp4 v0.0.0-20190909130307-a50d88189771
github.com/pin/tftp v2.1.0+incompatible
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b
golang.org/x/net v0.0.0-20221004154528-8021a29435af
gopkg.in/fsnotify/fsnotify.v0 v0.9.3
)

require (
github.com/go-fsnotify/fsnotify v0.0.0-20180321022601-755488143dae // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,5 @@ golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify/fsnotify.v0 v0.9.3 h1:Qke+vpckVuigBNmqJ6EweceG72hW1r2lxucoUnuUXxg=
gopkg.in/fsnotify/fsnotify.v0 v0.9.3/go.mod h1:oaVKIuuxa7CBnam0+Gp2G+nrA1oCSgjC4Vo3ooJLH1w=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
10 changes: 5 additions & 5 deletions lib/fsutil/watchFile_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"

"github.com/Cloud-Foundations/Dominator/lib/log"
"gopkg.in/fsnotify/fsnotify.v0"
"github.com/fsnotify/fsnotify"
)

var (
Expand All @@ -27,7 +27,7 @@ func watchFileWithFsNotify(pathname string, channel chan<- io.ReadCloser,
watchers = append(watchers, watcher)
pathname = path.Clean(pathname)
dirname := path.Dir(pathname)
if err := watcher.WatchFlags(dirname, fsnotify.FSN_CREATE); err != nil {
if err := watcher.Add(dirname); err != nil {
logger.Println("Error adding watch:", err)
return false
}
Expand All @@ -45,7 +45,7 @@ func watchFileStopWithFsNotify() bool {
// Wait for cleanup of each watcher.
for _, watcher := range watchers {
for {
if _, ok := <-watcher.Event; !ok {
if _, ok := <-watcher.Events; !ok {
break
}
}
Expand All @@ -61,7 +61,7 @@ func waitForNotifyEvents(watcher *fsnotify.Watcher, pathname string,
}
for {
select {
case event, ok := <-watcher.Event:
case event, ok := <-watcher.Events:
if !ok {
return
}
Expand All @@ -78,7 +78,7 @@ func waitForNotifyEvents(watcher *fsnotify.Watcher, pathname string,
} else {
channel <- file
}
case err, ok := <-watcher.Error:
case err, ok := <-watcher.Errors:
if !ok {
return
}
Expand Down

0 comments on commit 2315290

Please sign in to comment.