diff mbox series

[Bluez,v1] btmgmt: add non-interactive quit on read-sysconfig

Message ID 20210831134420.Bluez.v1.1.Iea4821c4c33d0a0f1986b97a1f6cd885427348a8@changeid (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series [Bluez,v1] btmgmt: add non-interactive quit on read-sysconfig | expand

Commit Message

Howard Chung Aug. 31, 2021, 5:44 a.m. UTC
From: Yun-Hao Chung <howardchung@chromium.org>

This fixes the erros that read-sysconfig doesn't exit in non-interactive
mode.

Reviewed-by: Archie Pusaka <apusaka@chromium.org>
---
Test with following commands
run "btmgmt read-sysconfig" and make sure it exits correctly

 tools/btmgmt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

bluez.test.bot@gmail.com Aug. 31, 2021, 6:39 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=539559

---Test result---

Test Summary:
CheckPatch                    PASS      0.30 seconds
GitLint                       PASS      0.11 seconds
Prep - Setup ELL              PASS      37.75 seconds
Build - Prep                  PASS      0.08 seconds
Build - Configure             PASS      6.52 seconds
Build - Make                  PASS      172.74 seconds
Make Check                    PASS      8.58 seconds
Make Distcheck                PASS      195.39 seconds
Build w/ext ELL - Configure   PASS      6.38 seconds
Build w/ext ELL - Make        PASS      153.97 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz Sept. 1, 2021, 12:57 a.m. UTC | #2
Hi Howard,

On Mon, Aug 30, 2021 at 11:42 PM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=539559
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      0.30 seconds
> GitLint                       PASS      0.11 seconds
> Prep - Setup ELL              PASS      37.75 seconds
> Build - Prep                  PASS      0.08 seconds
> Build - Configure             PASS      6.52 seconds
> Build - Make                  PASS      172.74 seconds
> Make Check                    PASS      8.58 seconds
> Make Distcheck                PASS      195.39 seconds
> Build w/ext ELL - Configure   PASS      6.38 seconds
> Build w/ext ELL - Make        PASS      153.97 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Distcheck - PASS
> Desc: Run distcheck to check the distribution
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Applied, thanks.
diff mbox series

Patch

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index a840c428cc74..42ef9acefaea 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -1906,17 +1906,18 @@  static void read_sysconfig_rsp(uint8_t status, uint16_t len, const void *param,
 	if (status != 0) {
 		error("Read system configuration failed with status "
 				"0x%02x (%s)", status, mgmt_errstr(status));
-		return;
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 	}
 
 	tlv_list = mgmt_tlv_list_load_from_buf(param, len);
 	if (!tlv_list) {
 		error("Unable to parse response of read system configuration");
-		return;
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 	}
 
 	mgmt_tlv_list_foreach(tlv_list, print_mgmt_tlv, NULL);
 	mgmt_tlv_list_free(tlv_list);
+	bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 static void cmd_read_sysconfig(int argc, char **argv)