Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4210596pxb; Mon, 30 Aug 2021 22:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP2ya2zMhmCbR0g2XA3FA4E8PKvrU5LJiS6Vjyge+f6DAhp3A6qecXPoH2xRMKf/CNCefB X-Received: by 2002:a6b:e318:: with SMTP id u24mr21085866ioc.137.1630388721844; Mon, 30 Aug 2021 22:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630388721; cv=none; d=google.com; s=arc-20160816; b=coTz7wZ3xAgpgeCUOeWmoIS7+PRfu7iAOUw/fBEY1eb/jkBuGeQZHoyHAMJiKONR8p GuTRzK81j8qNmybPFKtx0qYR7K/77fGzcLWNh4TuaARNGlowIcX5FKfWHPFkKzYZKM/G RqyRqUQI7iA5pC9ClO3R9JlbVKM3gSyw6XKI/1IjDiZ/02tYw2CZGEs5HclEzgltO05S kXzwza5HV6I3kqdd6q4t2+CEp0fQJjHgoIdbWA+mgYQgQ6d3+y/7W4aq2Stnog3nT6cG SRVnUA1Hvyu0009aUppP1/nV2nAu4OsJIfk2KLP6b02MenAyaazaksC9qLlRUu32KRLJ yFfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=z4TKKgrRsdnniVVn0CdIX9ICR2CveZ1wtLngem9pa+I=; b=Kf7Nd+dmBrfGnhUR6EKiwhg1hpC++kQD3tRgUl3Fg1ZxRV7SFazH+jfb5N1PsDyB46 INLg2a4CXwEKQb/WGjO1hf9sOmkH09kLi1GBT/03N8twsacKHFICNfagEbu+MgxGF5ZZ MIdW7/BTFRcopdmz9x/XoGrRpCL7BL74zIuG0xE8jmkpUA//1EfoBafPg9DaoK+yGKUt j8PiSBKjTu3C/8I2/Rh3XFcL29pDItV/xVCwe1ySV3bVDQZPktRBHr2EUrvEw1Ajicex Zp18Q/ulUu5GI6t7Mw9LNWaHI+MQbm4lsOzjaPnwCwfuoZLDKBz+UQ3hi0GJbTp0VyGM TcGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GbF1Tczt; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si17658963ilh.146.2021.08.30.22.45.09; Mon, 30 Aug 2021 22:45:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GbF1Tczt; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235309AbhHaFph (ORCPT + 99 others); Tue, 31 Aug 2021 01:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235078AbhHaFph (ORCPT ); Tue, 31 Aug 2021 01:45:37 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94B8EC061575 for ; Mon, 30 Aug 2021 22:44:42 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id g73-20020a379d4c000000b003d3ed03ca28so6724898qke.23 for ; Mon, 30 Aug 2021 22:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=z4TKKgrRsdnniVVn0CdIX9ICR2CveZ1wtLngem9pa+I=; b=GbF1TcztpWKIdykcC0+SMexd2bXIHsVuGDL0olSrFRTshWwXIPlFb17UUFgbnmVkfM /BQVAfn7WG8Tv0rFdrXaQpl4L2mx2Ceq70SVfQPEseoSeNTp6AQOSZH7qelo1yEPeYvo Cg+l3JmHxff4NHDVVwRUYplPe6JjI7j0mVsWzylOu/UUAuIxXdUlTivVUl4CC8/mQ+/U jsaq/Pdua9yH5trOPfSxGTMoCMkLmv6XSQ19Ec2gdqry2igjuE0XKN8QdAv4bSyUW+Dm FTOIb+RHEJGh/Zgoyx9tgW1IKdLov1ka1eAaKWKtrmIxyLt/GwH9plhjy2HSSQXoJz0x fWnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=z4TKKgrRsdnniVVn0CdIX9ICR2CveZ1wtLngem9pa+I=; b=Gb1M1M0QNdypxFYdbruGQZKHnuveCyzeOJRERujhG8m1vfJK3jzI1fPXnSRSjfVtsk 5KM3PXV5mNDTa+gFU9Eb3DirSNMk3KrVxjHzby6Yglmk9Ed9TYoZPOjopr5/gbrqQoiK 2wc+4vQodE5G4trhPOoiUdrAa/ULSjlcWN+ANeG7TMQZq6SagZUTL+Wo6/wMI2iQNtv6 YhEDTmzaKcBdv9CGCS07SsNyr+KKbQ3XVH3ej0J5tOxTskkhJaZVV7gSPC4fh03Lyi5i GASkMvyNDCH0kveVXCbowelJveHwwosswn2Su3LDjsQebOdNsHFx1wh4gIJd4/y49am/ XV4w== X-Gm-Message-State: AOAM533GurjebXdvgpcyjMtp8Wz/xLCDnh6wTT7PnfUUu9p7QjvbUL9V kTyAMNEEYLJD+k2EpQTeIHw8MqCGixxu/xq0rZUwOu02rEplLphV6LcVNwaUWdTPAHzGOuTZITf zXTVrHkdCSRrXp8isLnIgtabXK5CdIHdqjs0fhUXh9p6yDkk8L6nkY/u2d3aIOGFJRrCkX7FFYt tyjhIoCR/xqyc= X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:93c2:6f3f:e782:13b0]) (user=howardchung job=sendgmr) by 2002:a05:6214:621:: with SMTP id a1mr27430578qvx.12.1630388681710; Mon, 30 Aug 2021 22:44:41 -0700 (PDT) Date: Tue, 31 Aug 2021 13:44:36 +0800 Message-Id: <20210831134420.Bluez.v1.1.Iea4821c4c33d0a0f1986b97a1f6cd885427348a8@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog Subject: [Bluez PATCH v1] btmgmt: add non-interactive quit on read-sysconfig From: Howard Chung To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: Yun-Hao Chung , Archie Pusaka Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Yun-Hao Chung This fixes the erros that read-sysconfig doesn't exit in non-interactive mode. Reviewed-by: Archie Pusaka --- 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(-) 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) -- 2.33.0.259.gc128427fd7-goog