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

Commit 3e1cb6d9 authored by Dan Albert's avatar Dan Albert
Browse files

Revert "Probably fix the Mac build."

This reverts commit 49513cbc.
parent 6b95c469
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -42,8 +42,9 @@ static const bool kWorkaroundBug6558362 = true;
static const bool kWorkaroundBug6558362 = false;
static const bool kWorkaroundBug6558362 = false;
#endif
#endif


static void adb_workaround_affinity(void) {
// We only build the affinity WAR code for Linux.
#if defined(__linux__)
#if defined(__linux__)
static void adb_set_affinity(void) {
    const char affinity_env[] = "ADB_CPU_AFFINITY_BUG6558362";
    const char affinity_env[] = "ADB_CPU_AFFINITY_BUG6558362";
    const char* cpunum_str = getenv(affinity_env);
    const char* cpunum_str = getenv(affinity_env);
    if (cpunum_str == nullptr || *cpunum_str == '\0') {
    if (cpunum_str == nullptr || *cpunum_str == '\0') {
@@ -67,10 +68,8 @@ static void adb_workaround_affinity(void) {


    sched_getaffinity(0, sizeof(cpu_set), &cpu_set);
    sched_getaffinity(0, sizeof(cpu_set), &cpu_set);
    D("new cpu_set[0]=0x%08lx\n", cpu_set.__bits[0]);
    D("new cpu_set[0]=0x%08lx\n", cpu_set.__bits[0]);
#else
    // No workaround was ever implemented for the other platforms.
#endif
}
}
#endif


#if defined(_WIN32)
#if defined(_WIN32)
static const char kNullFileName[] = "NUL";
static const char kNullFileName[] = "NUL";
@@ -136,9 +135,11 @@ int adb_main(int is_daemon, int server_port) {


    init_transport_registration();
    init_transport_registration();


#if defined(__linux__)
    if (kWorkaroundBug6558362 && is_daemon) {
    if (kWorkaroundBug6558362 && is_daemon) {
        adb_workaround_affinity();
        adb_set_affinity();
    }
    }
#endif


    usb_init();
    usb_init();
    local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);
    local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);