From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6E62A8E69 for ; Mon, 4 Jan 2016 03:00:12 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 03 Jan 2016 18:00:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,518,1444719600"; d="scan'208";a="873933685" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 03 Jan 2016 18:00:11 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 3 Jan 2016 18:00:10 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 3 Jan 2016 18:00:10 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.220]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0248.002; Mon, 4 Jan 2016 10:00:05 +0800 From: "Wang, Zhihong" To: Stephen Hemminger Thread-Topic: [PATCH v5 2/3] examples/l2fwd: Handle SIGINT and SIGTERM in l2fwd Thread-Index: AQHRQ4iWNogojaLeU0+ot2olJDy2xZ7kzLeAgAXR0oA= Date: Mon, 4 Jan 2016 02:00:04 +0000 Message-ID: <8F6C2BD409508844A0EFC19955BE09410338FD15@SHSMSX103.ccr.corp.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> <20151231090153.5f64ddc2@xeon-e3> In-Reply-To: <20151231090153.5f64ddc2@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjdjMzE1YTUtMzU5Zi00ZDcwLTk2YWMtODRmY2E1ZDA2MDZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMUhjNFJcLzd6VDAzV1J4bFhpNXE0aFo5Q0doUkR5dlhJcTlrT0xsOEpnNzQ9In0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Mon, 04 Jan 2016 02:00:12 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Friday, January 1, 2016 1:02 AM > To: Wang, Zhihong > Cc: dev@dpdk.org; Ananyev, Konstantin ; Qiu= , > Michael > Subject: Re: [PATCH v5 2/3] examples/l2fwd: Handle SIGINT and SIGTERM in > l2fwd >=20 > On Wed, 30 Dec 2015 16:59:50 -0500 > Zhihong Wang wrote: >=20 > > +static void > > +signal_handler(int signum) > > +{ > > + if (signum =3D=3D SIGINT || signum =3D=3D SIGTERM) { > > + printf("\n\nSignal %d received, preparing to exit...\n", > > + signum); > > + force_quit =3D true; >=20 > Actually, the if () is redundant since you only registered SIGINT, and SI= GTERM > those are the only signals you could possibly receive. Yes it's kind of an obsession I guess, just want to make the code crystal c= lear :) >=20 > Acked-by: Stephen Hemminger