Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6b340af authored by Spencer Low's avatar Spencer Low
Browse files

fix adb {forward,reverse} --no-rebind



adb forward --no-rebind (and the matching reverse command) seem to have
been broken by 424af02f. I fixed-up the
string parsing and also fixed the error message not to include
strerror(errno) since that does not apply because it is an
application-level error that doesn't have anything to do with the
OS/libc.

Change-Id: Iba7286283bfcf1782076355edcd9c355c0a0edfd
Signed-off-by: default avatarSpencer Low <CompareAndSwap@gmail.com>
parent fc2f1e61
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -770,12 +770,12 @@ int handle_forward_request(const char* service, TransportType type, const char*
        if (android::base::StartsWith(service, "killforward:")) {
            kill_forward = true;
            service += 12;
        } else {
            service += 8;   // skip past "forward:"
            if (android::base::StartsWith(service, "norebind:")) {
                no_rebind = true;
                service += 9;
            }
        } else {
            service += 8;
        }

        std::vector<std::string> pieces = android::base::Split(service, ";");
@@ -824,7 +824,7 @@ int handle_forward_request(const char* service, TransportType type, const char*
            message = android::base::StringPrintf("cannot bind to socket: %s", strerror(errno));
            break;
          case INSTALL_STATUS_CANNOT_REBIND:
            message = android::base::StringPrintf("cannot rebind existing socket: %s", strerror(errno));
            message = android::base::StringPrintf("cannot rebind existing socket");
            break;
          case INSTALL_STATUS_LISTENER_NOT_FOUND:
            message = android::base::StringPrintf("listener '%s' not found", service);