From: Ferruh Yigit Date: Wed, 16 May 2018 14:09:28 +0000 (+0100) Subject: log: fix pattern matching X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6ff0f81d0ef7;p=dpdk.git log: fix pattern matching 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") Signed-off-by: Ferruh Yigit --- diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index c660ca6592..818118944a 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; }