vendor: update github.com/rjeczalik/notify for go1.10 (#15785)

This commit is contained in:
Péter Szilágyi
2018-01-02 12:41:47 +02:00
committed by Felix Lange
parent 3e0113fff4
commit d2533d0efb
20 changed files with 229 additions and 158 deletions

View File

@ -6,7 +6,7 @@
package notify
import "syscall"
import "golang.org/x/sys/unix"
// Platform independent event values.
const (
@ -25,18 +25,18 @@ const (
// Inotify specific masks are legal, implemented events that are guaranteed to
// work with notify package on linux-based systems.
const (
InAccess = Event(syscall.IN_ACCESS) // File was accessed
InModify = Event(syscall.IN_MODIFY) // File was modified
InAttrib = Event(syscall.IN_ATTRIB) // Metadata changed
InCloseWrite = Event(syscall.IN_CLOSE_WRITE) // Writtable file was closed
InCloseNowrite = Event(syscall.IN_CLOSE_NOWRITE) // Unwrittable file closed
InOpen = Event(syscall.IN_OPEN) // File was opened
InMovedFrom = Event(syscall.IN_MOVED_FROM) // File was moved from X
InMovedTo = Event(syscall.IN_MOVED_TO) // File was moved to Y
InCreate = Event(syscall.IN_CREATE) // Subfile was created
InDelete = Event(syscall.IN_DELETE) // Subfile was deleted
InDeleteSelf = Event(syscall.IN_DELETE_SELF) // Self was deleted
InMoveSelf = Event(syscall.IN_MOVE_SELF) // Self was moved
InAccess = Event(unix.IN_ACCESS) // File was accessed
InModify = Event(unix.IN_MODIFY) // File was modified
InAttrib = Event(unix.IN_ATTRIB) // Metadata changed
InCloseWrite = Event(unix.IN_CLOSE_WRITE) // Writtable file was closed
InCloseNowrite = Event(unix.IN_CLOSE_NOWRITE) // Unwrittable file closed
InOpen = Event(unix.IN_OPEN) // File was opened
InMovedFrom = Event(unix.IN_MOVED_FROM) // File was moved from X
InMovedTo = Event(unix.IN_MOVED_TO) // File was moved to Y
InCreate = Event(unix.IN_CREATE) // Subfile was created
InDelete = Event(unix.IN_DELETE) // Subfile was deleted
InDeleteSelf = Event(unix.IN_DELETE_SELF) // Self was deleted
InMoveSelf = Event(unix.IN_MOVE_SELF) // Self was moved
)
var osestr = map[Event]string{
@ -56,15 +56,15 @@ var osestr = map[Event]string{
// Inotify behavior events are not **currently** supported by notify package.
const (
inDontFollow = Event(syscall.IN_DONT_FOLLOW)
inExclUnlink = Event(syscall.IN_EXCL_UNLINK)
inMaskAdd = Event(syscall.IN_MASK_ADD)
inOneshot = Event(syscall.IN_ONESHOT)
inOnlydir = Event(syscall.IN_ONLYDIR)
inDontFollow = Event(unix.IN_DONT_FOLLOW)
inExclUnlink = Event(unix.IN_EXCL_UNLINK)
inMaskAdd = Event(unix.IN_MASK_ADD)
inOneshot = Event(unix.IN_ONESHOT)
inOnlydir = Event(unix.IN_ONLYDIR)
)
type event struct {
sys syscall.InotifyEvent
sys unix.InotifyEvent
path string
event Event
}
@ -72,4 +72,4 @@ type event struct {
func (e *event) Event() Event { return e.event }
func (e *event) Path() string { return e.path }
func (e *event) Sys() interface{} { return &e.sys }
func (e *event) isDir() (bool, error) { return e.sys.Mask&syscall.IN_ISDIR != 0, nil }
func (e *event) isDir() (bool, error) { return e.sys.Mask&unix.IN_ISDIR != 0, nil }