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) { ...@@ -232,15 +232,27 @@ func (c *Connection) readMessage() (m *buffer.InMessage, err error) {
err = m.Init(c.wrapped.Dev) err = m.Init(c.wrapped.Dev)
c.wrapped.Rio.RUnlock() c.wrapped.Rio.RUnlock()
if err != nil { // Special cases:
c.destroyInMessage(m) //
m = nil // * ENODEV means fuse has hung up.
//
// Special case: ENODEV means fuse has hung up. // * EINTR means we should try again. (This seems to happen often on
if pe, ok := err.(*os.PathError); ok && pe.Err == syscall.ENODEV { // OS X, cf. http://golang.org/issue/11180)
//
if pe, ok := err.(*os.PathError); ok {
switch pe.Err {
case syscall.ENODEV:
err = io.EOF err = io.EOF
case syscall.EINTR:
err = nil
continue
} }
}
if err != nil {
c.destroyInMessage(m)
m = nil
return 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