From cd6c68c83f573d2478b6291b7df546021df971f3 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 15:54:02 +1000 Subject: [PATCH] Fixed some build errors. --- mount_darwin.go | 10 +++++----- mounted_file_system.go | 11 +++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mount_darwin.go b/mount_darwin.go index 41137cd..428b73a 100644 --- a/mount_darwin.go +++ b/mount_darwin.go @@ -53,13 +53,13 @@ func openOSXFUSEDev() (dev *os.File, err error) { func callMount( dir string, - cfg *mountConfig, + cfg *MountConfig, dev *os.File, ready chan<- error) (err error) { const bin = "/Library/Filesystems/osxfusefs.fs/Support/mount_osxfusefs" // The mount helper doesn't understand any escaping. - for k, v := range conf.options { + for k, v := range cfg.toMap() { if strings.Contains(k, ",") || strings.Contains(v, ",") { return fmt.Errorf( "mount options cannot contain commas on darwin: %q=%q", @@ -72,7 +72,7 @@ func callMount( // buffer. cmd := exec.Command( bin, - "-o", conf.getOptions(), + "-o", cfg.toOptionsString(), // Tell osxfuse-kext how large our buffer is. It must split // writes larger than this into multiple writes. // @@ -121,7 +121,7 @@ func callMount( // service the connection in order for mounting to complete. func mount( dir string, - conf *mountConfig, + cfg *MountConfig, ready chan<- error) (dev *os.File, err error) { // Open the device. dev, err = openOSXFUSEDev() @@ -145,7 +145,7 @@ func mount( } // Call the mount binary with the device. - err = callMount(dir, conf, dev, ready) + err = callMount(dir, cfg, dev, ready) if err != nil { dev.Close() err = fmt.Errorf("callMount: %v", err) diff --git a/mounted_file_system.go b/mounted_file_system.go index 4a57ec6..2d4ab4e 100644 --- a/mounted_file_system.go +++ b/mounted_file_system.go @@ -112,6 +112,17 @@ type MountConfig struct { Options map[string]string } +// Create a map containing all of the key=value mount options to be given to +// the mount helper. +func (c *MountConfig) toMap() (opts map[string]string) { + panic("TODO") +} + +// Create an options string suitable for passing to the mount helper. +func (c *MountConfig) toOptionsString() string { + panic("TODO") +} + // Convert to mount options to be passed to package fuseshim. func (c *MountConfig) bazilfuseOptions() (opts []fuseshim.MountOption) { isDarwin := runtime.GOOS == "darwin"