Merge "adbd: support ro.adb.nonblocking_ffs."
diff --git a/client/adb_client.cpp b/client/adb_client.cpp
index 9fa827d..5a7bc8d 100644
--- a/client/adb_client.cpp
+++ b/client/adb_client.cpp
@@ -259,7 +259,7 @@
         if (fd >= 0) {
             std::string version_string;
             if (!ReadProtocolString(fd, &version_string, error)) {
-                return -1;
+                return false;
             }
 
             ReadOrderlyShutdown(fd);
diff --git a/client/commandline.cpp b/client/commandline.cpp
index bb30ae5..43a3e5e 100644
--- a/client/commandline.cpp
+++ b/client/commandline.cpp
@@ -295,7 +295,10 @@
                     callback->OnStderr(buffer_ptr, length);
                     break;
                 case ShellProtocol::kIdExit:
-                    exit_code = protocol->data()[0];
+                    // data() returns a char* which doesn't have defined signedness.
+                    // Cast to uint8_t to prevent 255 from being sign extended to INT_MIN,
+                    // which doesn't get truncated on Windows.
+                    exit_code = static_cast<uint8_t>(protocol->data()[0]);
                     continue;
                 default:
                     continue;
diff --git a/daemon/usb.cpp b/daemon/usb.cpp
index 1eade39..b42236e 100644
--- a/daemon/usb.cpp
+++ b/daemon/usb.cpp
@@ -115,7 +115,7 @@
 };
 
 struct IoBlock {
-    bool pending;
+    bool pending = false;
     struct iocb control;
     std::shared_ptr<Block> payload;