Permalink
Browse files

fs: really disable android extensions if they are not supported.

  • Loading branch information...
1 parent fc6b2b4 commit 75b2f149002c1eb20e6ab46706604ec2a0dbc185 @hanwen committed Feb 18, 2013
Showing with 3 additions and 5 deletions.
  1. +3 −5 fs/fs.go
View
@@ -49,10 +49,8 @@ type DeviceFs struct {
// storage. Arguments are the opened mtp device and a directory for the
// backing store.
func NewDeviceFs(d *mtp.Device, storages []uint32, options DeviceFsOptions) (*DeviceFs, error) {
- o := options
-
root := rootNode{}
- fs := &DeviceFs{root: &root, dev: d, options: &o}
+ fs := &DeviceFs{root: &root, dev: d, options: &options}
root.fs = fs
fs.storages = storages
err := d.GetDeviceInfo(&fs.devInfo)
@@ -61,7 +59,7 @@ func NewDeviceFs(d *mtp.Device, storages []uint32, options DeviceFsOptions) (*De
}
if !strings.Contains(fs.devInfo.MTPExtension, "android.com") {
- options.Android = false
+ fs.options.Android = false
}
if !options.Android {
@@ -78,7 +76,7 @@ func NewDeviceFs(d *mtp.Device, storages []uint32, options DeviceFsOptions) (*De
return nil, err
}
- fs.mungeVfat[sid] = info.IsRemovable() && o.RemovableVFat
+ fs.mungeVfat[sid] = info.IsRemovable() && fs.options.RemovableVFat
}
return fs, nil

0 comments on commit 75b2f14

Please sign in to comment.