Refactor epoll monitor for generic use

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-09-22 14:03:45 -07:00
parent b6bf350a07
commit 97c3c3847a
10 changed files with 288 additions and 297 deletions

View file

@ -67,7 +67,7 @@ type OOM interface {
io.Closer
FD() int
ContainerID() string
Flush()
Flush() error
Removed() bool
}
@ -692,9 +692,10 @@ func (o *oom) FD() int {
return o.eventfd
}
func (o *oom) Flush() {
func (o *oom) Flush() error {
buf := make([]byte, 8)
syscall.Read(o.eventfd, buf)
_, err := syscall.Read(o.eventfd, buf)
return err
}
func (o *oom) Removed() bool {