From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v5 2/3] examples/l2fwd: Handle SIGINT and SIGTERM in l2fwd Date: Thu, 31 Dec 2015 09:01:53 -0800 Message-ID: <20151231090153.5f64ddc2@xeon-e3> References: <1451011032-83106-1-git-send-email-zhihong.wang@intel.com> <1451512791-5442-1-git-send-email-zhihong.wang@intel.com> <1451512791-5442-3-git-send-email-zhihong.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Zhihong Wang Return-path: Received: from mail-pf0-f170.google.com (mail-pf0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id F0003559C for ; Thu, 31 Dec 2015 18:01:45 +0100 (CET) Received: by mail-pf0-f170.google.com with SMTP id q63so122250653pfb.0 for ; Thu, 31 Dec 2015 09:01:45 -0800 (PST) In-Reply-To: <1451512791-5442-3-git-send-email-zhihong.wang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 30 Dec 2015 16:59:50 -0500 Zhihong Wang wrote: > +static void > +signal_handler(int signum) > +{ > + if (signum == SIGINT || signum == SIGTERM) { > + printf("\n\nSignal %d received, preparing to exit...\n", > + signum); > + force_quit = true; Actually, the if () is redundant since you only registered SIGINT, and SIGTERM those are the only signals you could possibly receive. Acked-by: Stephen Hemminger