This repository was archived by the owner on Oct 28, 2025. It is now read-only.
Tags: tywkeene/go-fsevents
Tags
ReadSingleEvent: fixes and improvements (#22) * ReadSingleEvent: fix buffer size According to inotify(7), > Specifying a buffer of size > > sizeof(struct inotify_event) + NAME_MAX + 1 > > will be sufficient to read at least one event. Fix the size accordingly. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> * ReadSingleEvent: use unix.Read This calls the read(2), so it is as good as C.read() but without a need for cgo. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> * ReadSingleEvent: fix error handling Since read(2) returns -1 in case of error, the actual reading error was never returned because the bytesRead < unix.SizeofInotifyEvent check was performed first. Reverse the order of checks to fix. Drop "else" since it's not needed after 'return'. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>