Commit c5dd9268 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Use Go naming style for mount_bin.

parent f4ec7a2b
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
"unsafe" "unsafe"
) )
var mount_bin string = "/bin/fusermount" var mountBinary string = "/bin/fusermount"
func Socketpair(network string) (l, r *os.File, err os.Error) { func Socketpair(network string) (l, r *os.File, err os.Error) {
var domain int var domain int
...@@ -55,13 +55,13 @@ func mount(mountPoint string, options string) (f *os.File, finalMountPoint strin ...@@ -55,13 +55,13 @@ func mount(mountPoint string, options string) (f *os.File, finalMountPoint strin
mountPoint = filepath.Clean(filepath.Join(cwd, mountPoint)) mountPoint = filepath.Clean(filepath.Join(cwd, mountPoint))
} }
cmd := []string{mount_bin, mountPoint} cmd := []string{mountBinary, mountPoint}
if options != "" { if options != "" {
cmd = append(cmd, "-o") cmd = append(cmd, "-o")
cmd = append(cmd, options) cmd = append(cmd, options)
} }
proc, err := os.StartProcess(mount_bin, proc, err := os.StartProcess(mountBinary,
cmd, cmd,
&os.ProcAttr{ &os.ProcAttr{
Env: []string{"_FUSE_COMMFD=3"}, Env: []string{"_FUSE_COMMFD=3"},
...@@ -86,8 +86,8 @@ func mount(mountPoint string, options string) (f *os.File, finalMountPoint strin ...@@ -86,8 +86,8 @@ func mount(mountPoint string, options string) (f *os.File, finalMountPoint strin
func unmount(mountPoint string) (err os.Error) { func unmount(mountPoint string) (err os.Error) {
dir, _ := filepath.Split(mountPoint) dir, _ := filepath.Split(mountPoint)
proc, err := os.StartProcess(mount_bin, proc, err := os.StartProcess(mountBinary,
[]string{mount_bin, "-u", mountPoint}, []string{mountBinary, "-u", mountPoint},
&os.ProcAttr{Dir: dir, Files: []*os.File{nil, nil, os.Stderr}}) &os.ProcAttr{Dir: dir, Files: []*os.File{nil, nil, os.Stderr}})
if err != nil { if err != nil {
return return
...@@ -138,7 +138,7 @@ func init() { ...@@ -138,7 +138,7 @@ func init() {
tpath := path.Join(v, "fusermount") tpath := path.Join(v, "fusermount")
fi, err := os.Stat(tpath) fi, err := os.Stat(tpath)
if err == nil && (fi.Mode&0111) != 0 { if err == nil && (fi.Mode&0111) != 0 {
mount_bin = tpath mountBinary = tpath
break break
} }
} }
......
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