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

Commit d7f1feb5 authored by JP Abgrall's avatar JP Abgrall
Browse files

adb: fix exit of "adb root" when it is a no-op.

"adb root" creates a socket, then starts the service.
Socket creation should not set the exit_on_close when the service will be
a no-op.

Bug: 6259353
Change-Id: Ie526d2fad64f39a48051ed0ff6fb3405c2802ced
parent b012679f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -426,8 +426,9 @@ asocket *create_local_service_socket(const char *name)
    s = create_local_socket(fd);
    D("LS(%d): bound to '%s' via %d\n", s->id, name, fd);

    if (!strcmp(name, "root:") || !strcmp(name, "usb:") ||
                                  !strcmp(name, "tcpip:")) {
    if ((!strcmp(name, "root:") && getuid() != 0)
        || !strcmp(name, "usb:")
        || !strcmp(name, "tcpip:")) {
        D("LS(%d): enabling exit_on_close\n", s->id);
        s->exit_on_close = 1;
    }