From patchwork Fri Jul 18 12:54:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 4583201 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6DF8BC0514 for ; Fri, 18 Jul 2014 12:58:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7D9620120 for ; Fri, 18 Jul 2014 12:58:06 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mail.kernel.org (Postfix) with ESMTP id DB2DD2011E for ; Fri, 18 Jul 2014 12:58:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6ICsM2r004511; Fri, 18 Jul 2014 08:54:22 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s6ICsKea005942 for ; Fri, 18 Jul 2014 08:54:20 -0400 Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6ICsKlv020098 for ; Fri, 18 Jul 2014 08:54:20 -0400 Received: from sf2.bxl.stone.is (sf2.bxl.stone.is [5.134.1.239]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6ICsHFp024575 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 18 Jul 2014 08:54:17 -0400 Received: from [87.238.167.34] (helo=smtprelay.1eurohost.com) by sf2.bxl.stone.is with esmtp (Exim 4.82) (envelope-from ) id 1X87fz-0005Jg-D1; Fri, 18 Jul 2014 14:54:16 +0200 Received: from vz19.stone-is.net (vz19.stone-is.net [87.238.162.57]) by smtprelay.1eurohost.com (Postfix) with ESMTP id 3DEE92208FB; Fri, 18 Jul 2014 14:54:14 +0200 (CEST) X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.117] (178-119-65-67.access.telenet.be [178.119.65.67]) by vz19.stone-is.net (Postfix) with ESMTPSA id B30F189203; Fri, 18 Jul 2014 14:54:15 +0200 (CEST) Message-ID: <53C918F5.2050703@acm.org> Date: Fri, 18 Jul 2014 14:54:13 +0200 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: christophe.varoqui@opensvc.com References: <53C91871.9070402@acm.org> In-Reply-To: <53C91871.9070402@acm.org> X-Enigmail-Version: 1.6 X-Filter-ID: XtLePq6GTMn8G68F0EmQvdthj6rk7ohlAkaRQG+cDaLZlN3ufQ0ZRHdy43341LQ0JYRGiu4wDuX/ sGw1Y7RAsQVCOi2K3ZygpdQwUC1xM8uHTLHcW1YhPsFnFxvjWlQPLZy1RAw8+2yZuh2VuYuU9z8U a6+MdljsDo+RKX0yPPDwoVJnpeAWJjfTvWCbG36LwJOqJV51iSPXek1m27w/m+HNZvRbeH/WodDC Pyd1hEHbiTiodCOnGJJ238+JDuVLnqZHQ6G3sZaRFyyBo8hsnH9T+OwfgRcaB9RPsshfI97D4gz4 tcU5YI1KNYsC2/V3glLeZCD1voA8s0bkUEtPw/GX+ObfaU6whL8xq/xH+as21Cee63EeltfbuaMM NA5XR/lhzJ4Pd6XOYPUh1LatWl4K/BrAvODv+H53lohFBx5WhVa6zifUH6X26a/6lVhrtJVcNrFf 4GaM5Eg5slNOY1NHQAvSZpDy3ysxabiXOiY8rN5kPduYoOjRk/4SxcBWjjQNtXRKSR1sOD289304 szpgkzbBMkWtGTUmSRdnNNTqrNZ1EgtZond7q2FKC0V2DjB8+DxmdJyMgaP/BJhXML08KlEIRB/1 zhErtZP4jFj74O4hBSz/kkmPgL+fgIguP7zVxQ8/MinsvL3XSVaM87zsNy3vhxHFEhzEUW2s4y8l G+iucR8wMCVHyHsimo/bhMIZHdSilwF/ZU2dwKqv4A== X-Report-Abuse-To: spam@sf1.bxl.stone.is X-Filter-Fingerprint: cPaH8lomer6UwsJ3BnJDysg56Hzi1baYmi2c/60G48S0VFDyP20las9Mq1v6nXmfrqKtWpHLpkE8 c09GKJn2tzYPufyXhSp/2Ho1/pNadjPd1PHxHTVUQ6kKwyUfwBkXbbcemmvc6LV6reHAmFfSz0ej vfBM5HDil32B6EA6ECAwtB2mFrRhH9FyTxY8sWyBcs5YafE/xIdJMElFA1BzlJjp2wMQvksbXuh+ Zur/YDgNaJU0bkU579fapNXDRWH7lv8Ffx5tjiiMQ9xvR0covSWj1kd0N16AJIzbHn3urryUOSbt rhiR0dBuPv/XixcLgZGW1Q2YRaufTGd4ws1788KKGz4SH7FWti8gG83XdVBmLcRjbh4tt+C7QLi/ d0JLh7cxcjsgBTxNJWWHM9ZBsyb0iDyxIyoedIlOoGOP+kg4WNW5IE3LlEe0p1AaVStrnfW5fBRH 93BuV4EXYIb6Ew== X-Originating-IP: 87.238.167.34 X-SpamExperts-Domain: stone.is X-SpamExperts-Username: 87.238.167.34 Authentication-Results: bxl.stone.is; auth=pass smtp.auth=87.238.167.34 X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.03) X-Recommended-Action: accept X-RedHat-Spam-Score: -1.235 (BAYES_00,SPF_SOFTFAIL) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.16 X-loop: dm-devel@redhat.com Cc: device-mapper development , Sebastian Herbszt Subject: [dm-devel] [PATCH 4/5] libmultipath: Print line number for which parsing failed X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make it easier to figure out which line contains a syntax error by printing the line number and the offending line itself. Signed-off-by: Bart Van Assche --- libmultipath/parser.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libmultipath/parser.c b/libmultipath/parser.c index b7bdfcc..d8673bc 100644 --- a/libmultipath/parser.c +++ b/libmultipath/parser.c @@ -460,7 +460,7 @@ int process_stream(vector keywords) { int i; - int r = 0; + int r = 0, t; struct keyword *keyword; char *str; char *buf; @@ -501,8 +501,13 @@ process_stream(vector keywords) free_strvec(strvec); goto out; } - if (keyword->handler) - r += (*keyword->handler) (strvec); + if (keyword->handler) { + t = (*keyword->handler) (strvec); + r += t; + if (t) + condlog(1, "multipath.conf +%d parsing failed: %s", + line_nr, buf); + } if (keyword->sub) { kw_level++;