From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id DF0151B016 for ; Wed, 16 May 2018 16:09:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2018 07:09:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,390,1520924400"; d="scan'208";a="41735027" Received: from silpixa00399777.ir.intel.com (HELO silpixa00399777.ger.corp.intel.com) ([10.237.222.236]) by orsmga008.jf.intel.com with ESMTP; 16 May 2018 07:09:48 -0700 From: Ferruh Yigit To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit , stephen@networkplumber.org Date: Wed, 16 May 2018 15:09:28 +0100 Message-Id: <20180516140928.76570-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180516140523.75519-1-ferruh.yigit@intel.com> References: <20180516140523.75519-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v2] 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: , X-List-Received-Date: Wed, 16 May 2018 14:09:52 -0000 loglevel set wrong when ":" is used as separator, 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 --- v2: * s/seperator/separator/ in commit log --- 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; } -- 2.14.3