1*4882a593SmuzhiyunFrom 75a708d9345f057cf6c11635534ded7ccef4070a Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Jeffy Chen <jeffy.chen@rock-chips.com> 3*4882a593SmuzhiyunDate: Thu, 20 Oct 2022 12:03:16 +0800 4*4882a593SmuzhiyunSubject: [PATCH 20/20] adbd: Support setting adb shell 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunTested with: 7*4882a593Smuzhiyuncat /etc/profile.d/adbd.sh 8*4882a593Smuzhiyunexport ADBD_SHELL=/bin/bash 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunSigned-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 11*4882a593Smuzhiyun--- 12*4882a593Smuzhiyun core/adbd/services.c | 5 +++-- 13*4882a593Smuzhiyun 1 file changed, 3 insertions(+), 2 deletions(-) 14*4882a593Smuzhiyun 15*4882a593Smuzhiyundiff --git a/core/adbd/services.c b/core/adbd/services.c 16*4882a593Smuzhiyunindex 239f49f..2006d14 100644 17*4882a593Smuzhiyun--- a/core/adbd/services.c 18*4882a593Smuzhiyun+++ b/core/adbd/services.c 19*4882a593Smuzhiyun@@ -383,10 +383,11 @@ static int create_subproc_thread(const char *name) 20*4882a593Smuzhiyun adb_thread_t t; 21*4882a593Smuzhiyun int ret_fd; 22*4882a593Smuzhiyun pid_t pid; 23*4882a593Smuzhiyun+ const char *shell = getenv("ADBD_SHELL") ? : SHELL_COMMAND; 24*4882a593Smuzhiyun if(name) { 25*4882a593Smuzhiyun- ret_fd = create_subprocess(SHELL_COMMAND, "-c", name, &pid); 26*4882a593Smuzhiyun+ ret_fd = create_subprocess(shell, "-c", name, &pid); 27*4882a593Smuzhiyun } else { 28*4882a593Smuzhiyun- ret_fd = create_subprocess(SHELL_COMMAND, 0, 0, &pid); 29*4882a593Smuzhiyun+ ret_fd = create_subprocess(shell, 0, 0, &pid); 30*4882a593Smuzhiyun } 31*4882a593Smuzhiyun D("create_subprocess() ret_fd=%d pid=%d\n", ret_fd, pid); 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun-- 34*4882a593Smuzhiyun2.20.1 35*4882a593Smuzhiyun 36