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

Commit 052679ba authored by LuK1337's avatar LuK1337 Committed by Rashed Abdel-Tawab
Browse files

adb: host: Fix windows build after 5c0999c2

* Windows fd_set struct uses SOCKET type,
  therefore we need to cast device_fd to
  cutils_socket_t so that it's int on
  Linux and SOCKET on Windows, otherwise
  we might get comparison of integers of
  different signs error.

Change-Id: I13357dff5563fbbafb59cfc34b2e8ccdf7b86a79
parent 7d05926d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include <android-base/parseint.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <cutils/sockets.h>

#if !defined(_WIN32)
#include <signal.h>
@@ -911,7 +912,7 @@ static int adb_sideload_install(const char* filename, bool rescue_mode) {
        fd_set fds;
        struct timeval tv;
        FD_ZERO(&fds);
        FD_SET(device_fd, &fds);
        FD_SET(static_cast<cutils_socket_t>(device_fd), &fds);
        tv.tv_sec = 1;
        tv.tv_usec = 0;
        int rc = select(device_fd+1, &fds, NULL, NULL, &tv);