From patchwork Wed May 16 14:05:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 40102 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B44F1B170; Wed, 16 May 2018 16:05:47 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2EE231B052 for ; Wed, 16 May 2018 16:05:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 07:05:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,390,1520924400"; d="scan'208";a="54871222" Received: from silpixa00399777.ir.intel.com (HELO silpixa00399777.ger.corp.intel.com) ([10.237.222.236]) by fmsmga004.fm.intel.com with ESMTP; 16 May 2018 07:05:43 -0700 From: Ferruh Yigit To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit , stephen@networkplumber.org Date: Wed, 16 May 2018 15:05:23 +0100 Message-Id: <20180516140523.75519-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.14.3 Subject: [dpdk-dev] [PATCH] log: fix pattern matching X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" loglevel set wrong when ":" is used as seperator, like --log-type="user:debug" This is because fnmatch returns zero on success. Fixed fnmatch return value check. Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing") Cc: stephen@networkplumber.org Signed-off-by: Ferruh Yigit --- lib/librte_eal/common/eal_common_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index c660ca659..818118944 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -184,7 +184,7 @@ rte_log_set_level_pattern(const char *pattern, uint32_t level) if (rte_logs.dynamic_types[i].name == NULL) continue; - if (fnmatch(pattern, rte_logs.dynamic_types[i].name, 0)) + if (fnmatch(pattern, rte_logs.dynamic_types[i].name, 0) == 0) rte_logs.dynamic_types[i].loglevel = level; }