Plumb more of the error reporting through.
This doesn't fix the bug, but it does flatten the bug to the well-known
and long-standing "adb shell" doesn't return exit statuses, so when we
fix that, this one will fix itself.
Bug: http://b/20423886
Change-Id: I48351e46f05dd3f2f6e57f0df1d851333458d0ef
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index 58e1ade..e76c341 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -764,8 +764,7 @@
cmd += " " + escape_arg(*argv++);
}
- send_shell_command(transport, serial, cmd);
- return 0;
+ return send_shell_command(transport, serial, cmd);
}
static int mkdirs(const char *path)
@@ -1603,8 +1602,7 @@
cmd += " " + escape_arg(*argv++);
}
- send_shell_command(transport, serial, cmd);
- return 0;
+ return send_shell_command(transport, serial, cmd);
}
static int uninstall_app(transport_type transport, const char* serial, int argc,
@@ -1629,8 +1627,7 @@
static int delete_file(transport_type transport, const char* serial, char* filename)
{
std::string cmd = "shell:rm -f " + escape_arg(filename);
- send_shell_command(transport, serial, cmd);
- return 0;
+ return send_shell_command(transport, serial, cmd);
}
static const char* get_basename(const char* filename)
@@ -1691,7 +1688,7 @@
argv[last_apk] = apk_dest; /* destination name, not source location */
}
- pm_command(transport, serial, argc, argv);
+ err = pm_command(transport, serial, argc, argv);
cleanup_apk:
delete_file(transport, serial, apk_dest);