Loading adb/client/adb_install.cpp +21 −8 Original line number Diff line number Diff line Loading @@ -227,18 +227,22 @@ static int install_app_streamed(int argc, const char** argv, bool use_fastdeploy return 1; } copy_to_file(local_fd.get(), remote_fd.get()); if (!copy_to_file(local_fd.get(), remote_fd.get())) { fprintf(stderr, "adb: failed to install: copy_to_file: %s: %s", file, strerror(errno)); return 1; } char buf[BUFSIZ]; read_status_line(remote_fd.get(), buf, sizeof(buf)); if (!strncmp("Success", buf, 7)) { fputs(buf, stdout); return 0; } if (strncmp("Success", buf, 7) != 0) { fprintf(stderr, "adb: failed to install %s: %s", file, buf); return 1; } fputs(buf, stdout); return 0; } static int install_app_legacy(int argc, const char** argv, bool use_fastdeploy) { printf("Performing Push Install\n"); Loading Loading @@ -455,7 +459,12 @@ int install_multiple_app(int argc, const char** argv) { goto finalize_session; } copy_to_file(local_fd.get(), remote_fd.get()); if (!copy_to_file(local_fd.get(), remote_fd.get())) { fprintf(stderr, "adb: failed to write \"%s\": %s\n", file, strerror(errno)); success = false; goto finalize_session; } read_status_line(remote_fd.get(), buf, sizeof(buf)); if (strncmp("Success", buf, 7)) { Loading Loading @@ -634,7 +643,11 @@ int install_multi_package(int argc, const char** argv) { goto finalize_multi_package_session; } copy_to_file(local_fd.get(), remote_fd.get()); if (!copy_to_file(local_fd.get(), remote_fd.get())) { fprintf(stderr, "adb: failed to write %s: %s\n", split.c_str(), strerror(errno)); goto finalize_multi_package_session; } read_status_line(remote_fd.get(), buf, sizeof(buf)); if (strncmp("Success", buf, 7)) { Loading adb/client/commandline.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -352,7 +352,8 @@ static void stdinout_raw_epilogue(int inFd, int outFd, int old_stdin_mode, int o #endif } void copy_to_file(int inFd, int outFd) { bool copy_to_file(int inFd, int outFd) { bool result = true; std::vector<char> buf(64 * 1024); int len; long total = 0; Loading @@ -375,6 +376,7 @@ void copy_to_file(int inFd, int outFd) { } if (len < 0) { D("copy_to_file(): read failed: %s", strerror(errno)); result = false; break; } if (outFd == STDOUT_FILENO) { Loading @@ -388,7 +390,8 @@ void copy_to_file(int inFd, int outFd) { stdinout_raw_epilogue(inFd, outFd, old_stdin_mode, old_stdout_mode); D("copy_to_file() finished after %lu bytes", total); D("copy_to_file() finished with %s after %lu bytes", result ? "success" : "failure", total); return result; } static void send_window_size_change(int fd, std::unique_ptr<ShellProtocol>& shell) { Loading adb/client/commandline.h +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ extern DefaultStandardStreamsCallback DEFAULT_STANDARD_STREAMS_CALLBACK; int adb_commandline(int argc, const char** argv); void copy_to_file(int inFd, int outFd); bool copy_to_file(int inFd, int outFd); // Connects to the device "shell" service with |command| and prints the // resulting output. Loading Loading
adb/client/adb_install.cpp +21 −8 Original line number Diff line number Diff line Loading @@ -227,18 +227,22 @@ static int install_app_streamed(int argc, const char** argv, bool use_fastdeploy return 1; } copy_to_file(local_fd.get(), remote_fd.get()); if (!copy_to_file(local_fd.get(), remote_fd.get())) { fprintf(stderr, "adb: failed to install: copy_to_file: %s: %s", file, strerror(errno)); return 1; } char buf[BUFSIZ]; read_status_line(remote_fd.get(), buf, sizeof(buf)); if (!strncmp("Success", buf, 7)) { fputs(buf, stdout); return 0; } if (strncmp("Success", buf, 7) != 0) { fprintf(stderr, "adb: failed to install %s: %s", file, buf); return 1; } fputs(buf, stdout); return 0; } static int install_app_legacy(int argc, const char** argv, bool use_fastdeploy) { printf("Performing Push Install\n"); Loading Loading @@ -455,7 +459,12 @@ int install_multiple_app(int argc, const char** argv) { goto finalize_session; } copy_to_file(local_fd.get(), remote_fd.get()); if (!copy_to_file(local_fd.get(), remote_fd.get())) { fprintf(stderr, "adb: failed to write \"%s\": %s\n", file, strerror(errno)); success = false; goto finalize_session; } read_status_line(remote_fd.get(), buf, sizeof(buf)); if (strncmp("Success", buf, 7)) { Loading Loading @@ -634,7 +643,11 @@ int install_multi_package(int argc, const char** argv) { goto finalize_multi_package_session; } copy_to_file(local_fd.get(), remote_fd.get()); if (!copy_to_file(local_fd.get(), remote_fd.get())) { fprintf(stderr, "adb: failed to write %s: %s\n", split.c_str(), strerror(errno)); goto finalize_multi_package_session; } read_status_line(remote_fd.get(), buf, sizeof(buf)); if (strncmp("Success", buf, 7)) { Loading
adb/client/commandline.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -352,7 +352,8 @@ static void stdinout_raw_epilogue(int inFd, int outFd, int old_stdin_mode, int o #endif } void copy_to_file(int inFd, int outFd) { bool copy_to_file(int inFd, int outFd) { bool result = true; std::vector<char> buf(64 * 1024); int len; long total = 0; Loading @@ -375,6 +376,7 @@ void copy_to_file(int inFd, int outFd) { } if (len < 0) { D("copy_to_file(): read failed: %s", strerror(errno)); result = false; break; } if (outFd == STDOUT_FILENO) { Loading @@ -388,7 +390,8 @@ void copy_to_file(int inFd, int outFd) { stdinout_raw_epilogue(inFd, outFd, old_stdin_mode, old_stdout_mode); D("copy_to_file() finished after %lu bytes", total); D("copy_to_file() finished with %s after %lu bytes", result ? "success" : "failure", total); return result; } static void send_window_size_change(int fd, std::unique_ptr<ShellProtocol>& shell) { Loading
adb/client/commandline.h +1 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ extern DefaultStandardStreamsCallback DEFAULT_STANDARD_STREAMS_CALLBACK; int adb_commandline(int argc, const char** argv); void copy_to_file(int inFd, int outFd); bool copy_to_file(int inFd, int outFd); // Connects to the device "shell" service with |command| and prints the // resulting output. Loading