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

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

adb: fix non-linux builds. tcpip:, root:, usb: are not for ADB_HOST

The handling of adb root:/tpcip:/usb: is normally only for non-ADB_HOST.
This avoids getuid() being invoked on windows builds.

Change-Id: I365b81d9f70de99b9347d3eac82e690a8ac5e747
parent d7f1feb5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -426,12 +426,14 @@ 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 !ADB_HOST
    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;
    }
#endif

    return s;
}