Fixed some build errors.
parent
19934c68be
commit
cd6c68c83f
|
@ -53,13 +53,13 @@ func openOSXFUSEDev() (dev *os.File, err error) {
|
||||||
|
|
||||||
func callMount(
|
func callMount(
|
||||||
dir string,
|
dir string,
|
||||||
cfg *mountConfig,
|
cfg *MountConfig,
|
||||||
dev *os.File,
|
dev *os.File,
|
||||||
ready chan<- error) (err error) {
|
ready chan<- error) (err error) {
|
||||||
const bin = "/Library/Filesystems/osxfusefs.fs/Support/mount_osxfusefs"
|
const bin = "/Library/Filesystems/osxfusefs.fs/Support/mount_osxfusefs"
|
||||||
|
|
||||||
// The mount helper doesn't understand any escaping.
|
// 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, ",") {
|
if strings.Contains(k, ",") || strings.Contains(v, ",") {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
"mount options cannot contain commas on darwin: %q=%q",
|
"mount options cannot contain commas on darwin: %q=%q",
|
||||||
|
@ -72,7 +72,7 @@ func callMount(
|
||||||
// buffer.
|
// buffer.
|
||||||
cmd := exec.Command(
|
cmd := exec.Command(
|
||||||
bin,
|
bin,
|
||||||
"-o", conf.getOptions(),
|
"-o", cfg.toOptionsString(),
|
||||||
// Tell osxfuse-kext how large our buffer is. It must split
|
// Tell osxfuse-kext how large our buffer is. It must split
|
||||||
// writes larger than this into multiple writes.
|
// writes larger than this into multiple writes.
|
||||||
//
|
//
|
||||||
|
@ -121,7 +121,7 @@ func callMount(
|
||||||
// service the connection in order for mounting to complete.
|
// service the connection in order for mounting to complete.
|
||||||
func mount(
|
func mount(
|
||||||
dir string,
|
dir string,
|
||||||
conf *mountConfig,
|
cfg *MountConfig,
|
||||||
ready chan<- error) (dev *os.File, err error) {
|
ready chan<- error) (dev *os.File, err error) {
|
||||||
// Open the device.
|
// Open the device.
|
||||||
dev, err = openOSXFUSEDev()
|
dev, err = openOSXFUSEDev()
|
||||||
|
@ -145,7 +145,7 @@ func mount(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the mount binary with the device.
|
// Call the mount binary with the device.
|
||||||
err = callMount(dir, conf, dev, ready)
|
err = callMount(dir, cfg, dev, ready)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dev.Close()
|
dev.Close()
|
||||||
err = fmt.Errorf("callMount: %v", err)
|
err = fmt.Errorf("callMount: %v", err)
|
||||||
|
|
|
@ -112,6 +112,17 @@ type MountConfig struct {
|
||||||
Options map[string]string
|
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.
|
// Convert to mount options to be passed to package fuseshim.
|
||||||
func (c *MountConfig) bazilfuseOptions() (opts []fuseshim.MountOption) {
|
func (c *MountConfig) bazilfuseOptions() (opts []fuseshim.MountOption) {
|
||||||
isDarwin := runtime.GOOS == "darwin"
|
isDarwin := runtime.GOOS == "darwin"
|
||||||
|
|
Loading…
Reference in New Issue