From c880ea681954d83ade8771c0d3220757ea9779f1 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 24 Mar 2015 15:36:09 +1100 Subject: [PATCH] Implemented the rest of Connection. --- connection.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/connection.go b/connection.go index 7070375..aab97f9 100644 --- a/connection.go +++ b/connection.go @@ -31,7 +31,14 @@ type Connection struct { // result. You must call c.close() eventually. func newConnection( logger *log.Logger, - wrapped *bazilfuse.Conn) (c *Connection, err error) + wrapped *bazilfuse.Conn) (c *Connection, err error) { + c = &Connection{ + logger: logger, + wrapped: wrapped, + } + + return +} // Read the next op from the kernel process. Return io.EOF if the kernel has // closed the connection. @@ -64,6 +71,13 @@ func (c *Connection) ReadOp() (op fuseops.Op, err error) { } } -func (c *Connection) waitForReady() (err error) +func (c *Connection) waitForReady() (err error) { + <-c.wrapped.Ready + err = c.wrapped.MountError + return +} -func (c *Connection) close() (err error) +func (c *Connection) close() (err error) { + err = c.wrapped.Close() + return +}