xref: /OK3568_Linux_fs/buildroot/package/android-tools/0020-adbd-Support-setting-adb-shell.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 75a708d9345f057cf6c11635534ded7ccef4070a Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Thu, 20 Oct 2022 12:03:16 +0800
4Subject: [PATCH 20/20] adbd: Support setting adb shell
5
6Tested with:
7cat /etc/profile.d/adbd.sh
8export ADBD_SHELL=/bin/bash
9
10Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
11---
12 core/adbd/services.c | 5 +++--
13 1 file changed, 3 insertions(+), 2 deletions(-)
14
15diff --git a/core/adbd/services.c b/core/adbd/services.c
16index 239f49f..2006d14 100644
17--- a/core/adbd/services.c
18+++ b/core/adbd/services.c
19@@ -383,10 +383,11 @@ static int create_subproc_thread(const char *name)
20     adb_thread_t t;
21     int ret_fd;
22     pid_t pid;
23+    const char *shell = getenv("ADBD_SHELL") ? : SHELL_COMMAND;
24     if(name) {
25-        ret_fd = create_subprocess(SHELL_COMMAND, "-c", name, &pid);
26+        ret_fd = create_subprocess(shell, "-c", name, &pid);
27     } else {
28-        ret_fd = create_subprocess(SHELL_COMMAND, 0, 0, &pid);
29+        ret_fd = create_subprocess(shell, 0, 0, &pid);
30     }
31     D("create_subprocess() ret_fd=%d pid=%d\n", ret_fd, pid);
32
33--
342.20.1
35
36