From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=LOq/Zlinsbry0HQv6c44piEWjNxVw1TYZ41ZEhM/5lM=; b=NpBKIUt1ZFwtuN6bFXtr54lgv+sYoI4epzOgGVP+eJ58Bt5WIXftUaY0u39U0zmEzT ucEAnsc9/oQJYn/dSkHF2VqXSmBrFgUZAIPJLy78tK7hsQYjsNZK/DM4biRutZx89Q20 l3LNfwjMkZLpDDC/ZoZ9ikvf7pc2EBKeJfsRujZXPAGpGDUyW4A7DvZ2dk2spr/0R2ag BGFru01DhXsDX5OyK/6bX0NRp51XRgn/uiKIg3P5rfrHUeq+zgIU/LmFpfauXXoy7oAy PPqGVzpCTHHxo5VWXgqseQDIplQaBAt5/Mzj+/uS8hiANijBw5LZl70YKewSWup4F05P 8E5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=LOq/Zlinsbry0HQv6c44piEWjNxVw1TYZ41ZEhM/5lM=; b=Bf/srVgOK0frYsvaU0EOLfnTBbXNTUi2DBemXSWG0Tv7BwajB0Y8XTljVrP+ffqHdu atPzfGCOm0/LxU9mbIb5YnqQKvBkZekWmX9QLC9arnr138XNWTBjLXfqDlZbheXr9LSM MmlRkjXp1WdAFUYkSOYZGeE1h91gviuzraBTRUa5G1y0O95NkHvW6mJ8ZmcvxXHjXMQK vlJ8VBtl5ViQ5dFITf0nBDeLA9imfiwFQWjAc37/8WbrtFTR6DP8Ilo5mFKQ1/CMDC6H RAlnI/wNAPE26/TQ/8sVU3tUvSClNusPvSL7AKAq2KEw0LLieiY61+CyjA1PJbtpY2mu zmTw== X-Gm-Message-State: ALoCoQmbRC7EAyo6GxWIha+VSerPm0Bijp7GBZOK/Qu1w+ZzIdxZCgljvsadHq+jsP0jMrEn6haiUwemflonRB3UA3qisNIl1g== X-Received: by 10.98.13.16 with SMTP id v16mr101424797pfi.129.1451581304216; Thu, 31 Dec 2015 09:01:44 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id sy5sm102881147pac.5.2015.12.31.09.01.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Dec 2015 09:01:43 -0800 (PST) Date: Thu, 31 Dec 2015 09:01:53 -0800 From: Stephen Hemminger To: Zhihong Wang Message-ID: <20151231090153.5f64ddc2@xeon-e3> In-Reply-To: <1451512791-5442-3-git-send-email-zhihong.wang@intel.com> 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 Subject: Re: [dpdk-dev] [PATCH v5 2/3] examples/l2fwd: Handle SIGINT and SIGTERM in l2fwd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2015 17:01:46 -0000 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