From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: , X-List-Received-Date: Wed, 16 May 2018 14:05:46 -0000 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; } -- 2.14.3