diff options
author | LuK1337 <priv.luk@gmail.com> | 2020-01-15 16:08:37 +0100 |
---|---|---|
committer | Rashed Abdel-Tawab <rashedabdeltawab@gmail.com> | 2020-02-08 22:10:07 +0100 |
commit | 052679ba2b4ae2c43397fa4acc58cd53eb11c9b1 (patch) | |
tree | b04f77125068663bf1af4e975aa53eb924646ac3 /adb/client/commandline.cpp | |
parent | 7d05926dc46b1379828c5b959ced7a24d15acd94 (diff) | |
download | system_core-052679ba2b4ae2c43397fa4acc58cd53eb11c9b1.tar.gz system_core-052679ba2b4ae2c43397fa4acc58cd53eb11c9b1.tar.bz2 system_core-052679ba2b4ae2c43397fa4acc58cd53eb11c9b1.zip |
adb: host: Fix windows build after 5c0999c
* 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
Diffstat (limited to 'adb/client/commandline.cpp')
-rw-r--r-- | adb/client/commandline.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/adb/client/commandline.cpp b/adb/client/commandline.cpp index a75050ab4..4cad03a8f 100644 --- a/adb/client/commandline.cpp +++ b/adb/client/commandline.cpp @@ -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); |