From a1dadab66e6b17e16853cd303f322f1dc01a713a Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 15:07:55 +1000 Subject: [PATCH] Fixed a bug. --- connection.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/connection.go b/connection.go index e93a996..b9c027d 100644 --- a/connection.go +++ b/connection.go @@ -16,10 +16,13 @@ package fuse import ( "fmt" + "io" "log" + "os" "path" "runtime" "sync" + "syscall" "golang.org/x/net/context" @@ -232,6 +235,12 @@ func (c *Connection) readMessage() (m *buffer.InMessage, err error) { 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 { + err = io.EOF + } + return }