> -----Original Message----- > From: Stephen Hemminger [mailto:stephen at networkplumber.org] > Sent: Friday, January 1, 2016 1:02 AM > To: Wang, Zhihong <zhihong.wang at intel.com> > Cc: dev at dpdk.org; Ananyev, Konstantin <konstantin.ananyev at intel.com>; > Qiu, > Michael <michael.qiu at intel.com> > Subject: Re: [PATCH v5 2/3] examples/l2fwd: Handle SIGINT and SIGTERM in > l2fwd > > On Wed, 30 Dec 2015 16:59:50 -0500 > Zhihong Wang <zhihong.wang at intel.com> 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.
Yes it's kind of an obsession I guess, just want to make the code crystal clear :) > > Acked-by: Stephen Hemminger <stephen at networkplumber.org>