From patchwork Mon Oct 21 21:51:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 285284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "userp1040.oracle.com", Issuer "VeriSign Class 3 International Server CA - G3" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E7ACC2C0143 for ; Tue, 22 Oct 2013 08:51:33 +1100 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9LLpSo2006689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Oct 2013 21:51:29 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9LLpRLK027289 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Oct 2013 21:51:28 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1VYNNn-0003ZN-N4; Mon, 21 Oct 2013 14:51:27 -0700 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1VYNNP-0003Sd-U5 for fedfs-utils-devel@oss.oracle.com; Mon, 21 Oct 2013 14:51:04 -0700 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9LLp3A7026590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Oct 2013 21:51:03 GMT Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by aserp1030.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9LLp2r3025073 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 21 Oct 2013 21:51:03 GMT Received: by mail-gg0-f182.google.com with SMTP id h13so1790608ggd.41 for ; Mon, 21 Oct 2013 14:51:02 -0700 (PDT) X-Received: by 10.236.171.195 with SMTP id r43mr2745720yhl.56.1382392262462; Mon, 21 Oct 2013 14:51:02 -0700 (PDT) Received: from manray.1015granger.net ([2604:8800:100:81fc:20c:29ff:fea5:adf]) by mx.google.com with ESMTPSA id v45sm30261793yha.2.2013.10.21.14.51.01 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 21 Oct 2013 14:51:02 -0700 (PDT) To: fedfs-utils-devel@oss.oracle.com From: Chuck Lever Date: Mon, 21 Oct 2013 17:51:01 -0400 Message-ID: <20131021215101.38809.64926.stgit@manray.1015granger.net> In-Reply-To: <20131021214030.38809.38712.stgit@manray.1015granger.net> References: <20131021214030.38809.38712.stgit@manray.1015granger.net> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=209.85.161.182 ct-class=R6 ct-vol1=0 ct-vol2=0 ct-vol3=0 ct-risk=68 ct-spam1=0 ct-spam2=0 ct-bulk=0 rcpts=1 size=2386 X-SPF-Info: PASS::mail-gg0-f182.google.com X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=LqGrlBtc c=1 sm=1 tr=0 a=oCO1Z5GD4lDFvIgABZT88g==:117 a=dzsqy3y4QnMA:10 a=3_FEs1UkMpEA:10 a=dPGociXpb70A:10 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=yPCof4ZbAAAA:8 a=Lb1rMZzfAAAA:8 a=1XWaLZrsAAAA:8 a=RAy5oe9x--oA:10 a=AS5ypNYrgRtkt Y6qXpEA:9 a=QEXdDO2ut3YA:10 a=7DSvI1NPTFQA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090206.5265A1C7.00AB, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [fedfs-utils] [PATCH 3/8] libxlog: Remove hidden calls to exit(2) X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] A packaging lint program caught a reference to exit(2) in our plug-in library. This call site was in libxlog, which is invoked from all of our libraries. As a rule, libraries should never exit out from under running programs. Fortunately, no-one in fedfs-utils uses L_FATAL or invokes xlog_err(). This exit(2) call is never invoked during run-time, and is safe to simply remove. Signed-off-by: Chuck Lever --- src/include/xlog.h | 4 +--- src/libxlog/xlog.c | 22 ---------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/include/xlog.h b/src/include/xlog.h index 9c9ec75..44f5efe 100644 --- a/src/include/xlog.h +++ b/src/include/xlog.h @@ -12,8 +12,7 @@ #include -/* These are logged always. L_FATAL also does exit(1) */ -#define L_FATAL 0x0100 +/* These are logged always. */ #define L_ERROR 0x0200 #define L_WARNING 0x0400 #define L_NOTICE 0x0800 @@ -47,7 +46,6 @@ void xlog_sconfig(char *, int on); int xlog_enabled(int fac); void xlog(int fac, const char *fmt, ...); void xlog_warn(const char *fmt, ...); -void xlog_err(const char *fmt, ...); void xlog_backend(int fac, const char *fmt, va_list args); #endif /* !_FEDFS_XLOG_H_ */ diff --git a/src/libxlog/xlog.c b/src/libxlog/xlog.c index cc21abc..8140b74 100644 --- a/src/libxlog/xlog.c +++ b/src/libxlog/xlog.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -191,9 +190,6 @@ xlog_backend(int kind, const char *fmt, va_list args) if (log_syslog) { switch (kind) { - case L_FATAL: - vsyslog(LOG_ERR, fmt, args); - break; case L_ERROR: vsyslog(LOG_ERR, fmt, args); break; @@ -228,9 +224,6 @@ xlog_backend(int kind, const char *fmt, va_list args) fprintf(stderr, "\n"); va_end(args2); } - - if (kind == L_FATAL) - exit(1); } /** @@ -263,18 +256,3 @@ xlog_warn(const char* fmt, ...) xlog_backend(L_WARNING, fmt, args); va_end(args); } - -/** - * Post a fatal log message - * - * @param fmt NUL-terminated C string containing printf-style format - */ -void -xlog_err(const char* fmt, ...) -{ - va_list args; - - va_start(args, fmt); - xlog_backend(L_FATAL, fmt, args); - va_end(args); -}