From: Chris Howey Date: Sat, 31 Dec 2011 05:04:51 +0000 (-0800) Subject: Linux, update to latest weekly Go X-Git-Tag: v1.7.2~448 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=a782bb13e548a4aacda649d963b400ae9948622c;p=fsnotify.git Linux, update to latest weekly Go --- diff --git a/fsnotify_linux.go b/fsnotify_linux.go index 28e29cf..08dbfb4 100644 --- a/fsnotify_linux.go +++ b/fsnotify_linux.go @@ -124,7 +124,7 @@ func (w *Watcher) addWatch(path string, flags uint32) error { } wd, errno := syscall.InotifyAddWatch(w.fd, path, flags) if wd == -1 { - return &os.PathError{"inotify_add_watch", path, os.Errno(errno)} + return errno } if !found { @@ -159,7 +159,7 @@ func (w *Watcher) readEvents() { var ( buf [syscall.SizeofInotifyEvent * 4096]byte // Buffer for a maximum of 4096 raw events n int // Number of bytes read with read() - errno int // Syscall errno + errno error // Syscall errno ) for { @@ -174,7 +174,7 @@ func (w *Watcher) readEvents() { // If EOF or a "done" message is received if n == 0 || done { errno := syscall.Close(w.fd) - if errno == -1 { + if errno != nil { w.Error <- os.NewSyscallError("close", errno) } close(w.Event)