Commit 4de334e0 authored by Aaron Jacobs's avatar Aaron Jacobs

Fixed a bug related to EINTR.

parent 816f77d7
......@@ -232,15 +232,27 @@ func (c *Connection) readMessage() (m *buffer.InMessage, err error) {
err = m.Init(c.wrapped.Dev)
c.wrapped.Rio.RUnlock()
if err != nil {
c.destroyInMessage(m)
m = nil
// Special case: ENODEV means fuse has hung up.
if pe, ok := err.(*os.PathError); ok && pe.Err == syscall.ENODEV {
// Special cases:
//
// * ENODEV means fuse has hung up.
//
// * EINTR means we should try again. (This seems to happen often on
// OS X, cf. http://golang.org/issue/11180)
//
if pe, ok := err.(*os.PathError); ok {
switch pe.Err {
case syscall.ENODEV:
err = io.EOF
case syscall.EINTR:
err = nil
continue
}
}
if err != nil {
c.destroyInMessage(m)
m = nil
return
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment