diff options
author | Elliott Hughes <enh@google.com> | 2009-10-06 18:07:49 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2009-10-06 18:07:49 -0700 |
commit | b4add9b74525210478bac702d27fdaf9cf7ab18f (patch) | |
tree | c25ecbe4025f917ffa2d40b2c8890555424a2eaf /fastboot/usb_osx.c | |
parent | 04b7f9d42e751c7b96b872075d0fca4f3249254a (diff) | |
download | system_core-b4add9b74525210478bac702d27fdaf9cf7ab18f.zip system_core-b4add9b74525210478bac702d27fdaf9cf7ab18f.tar.gz system_core-b4add9b74525210478bac702d27fdaf9cf7ab18f.tar.bz2 |
Make fastboot say "no permissions" for non-writable devices.
Without this patch, "adb devices" will say "no permissions" when it sees
a device it can't write to, but "fastboot devices" will silently ignore it.
This is confusing to n00bs, especially since it doesn't seem to be widely
known that a device's USB id might be different in the bootloader (meaning
two udev rules are needed). It can also be confusing if you're sshed in,
when you can't access the device because you won't be in the "plugdev"
group, but "fastboot devices" won't make this clear.
I'm not sure about the Mac OS and Windows changes. AIUI, devices are always
writable on those platforms, but I don't use either, so I can't test this.
This patch shouldn't alter the behavior on either of those platforms.
Diffstat (limited to 'fastboot/usb_osx.c')
-rw-r--r-- | fastboot/usb_osx.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fastboot/usb_osx.c b/fastboot/usb_osx.c index d6a8260..0b0512d 100644 --- a/fastboot/usb_osx.c +++ b/fastboot/usb_osx.c @@ -351,6 +351,7 @@ static int try_device(io_service_t device, usb_handle *handle) { // device has no serial number handle->info.serial_number[0] = 0; } + handle->info.writable = 1; if (try_interfaces(dev, handle)) { goto error; @@ -416,8 +417,6 @@ static int init_usb(ifc_match_func callback, usb_handle **handle) { break; } - usb_ifc_info info; - if (try_device(device, &h) != 0) { IOObjectRelease(device); ret = -1; |