diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-09-05 13:59:36 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-09-05 13:59:36 -0600 |
commit | b31d51e0b16f6233f2285adbab674ecfa2ace4ff (patch) | |
tree | 027677266bd9865f1ee9bb237853f0cb50da38cd /getgr | |
parent | 0d064cbe0675f9029b6ac27d12c6f462b18ffe82 (diff) |
inotify: Avoid most of the race conditions, get rid of Cint
There's still a condition that could be a race with fd-reuse, if one
goroutine is calling inotify.{AddWatch,RmWatch,Read}(); another
goroutine is calling inotify.Close(), and several things happen between
loadFd() running and the add_watch/rm_watch/read syscall launching:
- syscall.Close() returns
- syscall.Open() reuses the filedescriptor
A B
syscall(loadFd()) inotify.Close(); syscall.Open()
----------------------------------------------------------
loadFd()
syscall.Close()
syscall.Open()
syscall()
Given that Read() can't be allowed to block Close() from running, I'm not
sure there's a way to fix this.
Diffstat (limited to 'getgr')
0 files changed, 0 insertions, 0 deletions