From b4add9b74525210478bac702d27fdaf9cf7ab18f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 6 Oct 2009 18:07:49 -0700 Subject: 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. --- fastboot/fastboot.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fastboot/fastboot.c') diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c index c81222a8..8e92017d 100644 --- a/fastboot/fastboot.c +++ b/fastboot/fastboot.c @@ -165,6 +165,9 @@ int list_devices_callback(usb_ifc_info *info) { if (match_fastboot(info) == 0) { char* serial = info->serial_number; + if (!info->writable) { + serial = "no permissions"; // like "adb devices" + } if (!serial[0]) { serial = "????????????"; } -- cgit v1.2.3