From a782bb13e548a4aacda649d963b400ae9948622c Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Fri, 30 Dec 2011 21:04:51 -0800 Subject: [PATCH] Linux, update to latest weekly Go --- fsnotify_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.50.1