Expose adb executable path publicly

This will allow the caller to build the argv array directly.
This commit is contained in:
Romain Vimont 2022-02-05 09:37:00 +01:00
parent ba30ca5c1e
commit 5e2bfccab4
2 changed files with 6 additions and 3 deletions

View file

@ -13,8 +13,8 @@
static const char *adb_executable;
static inline const char *
get_adb_executable(void) {
const char *
sc_adb_get_executable(void) {
if (!adb_executable) {
adb_executable = getenv("ADB");
if (!adb_executable)
@ -163,7 +163,7 @@ sc_adb_create_argv(const char *serial, const char *const adb_cmd[],
return NULL;
}
argv[0] = get_adb_executable();
argv[0] = sc_adb_get_executable();
int i;
if (serial) {
argv[1] = "-s";

View file

@ -14,6 +14,9 @@
#define SC_ADB_SILENT (SC_ADB_NO_STDOUT | SC_ADB_NO_STDERR | SC_ADB_NO_LOGERR)
const char *
sc_adb_get_executable(void);
sc_pid
sc_adb_execute(const char *serial, const char *const adb_cmd[], size_t len,
unsigned flags);