From e43223bcc38e0eb68c65c1d37c82739716bc0523 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 31 Mar 2017 16:28:22 -0400 Subject: [PATCH] pimd: Cleanup unused variable write There exists a common pattern in pim where we were setting a variable to a value in the error case when we would no longer need it. Signed-off-by: Donald Sharp --- pimd/pim_igmp.c | 4 +--- pimd/pim_mroute.c | 6 ++---- pimd/pim_pim.c | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index e6582e2b17..ee88e7d8ea 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -876,10 +876,8 @@ pim_igmp_read (struct thread *t) if (errno == EINTR) continue; if (errno == EWOULDBLOCK || errno == EAGAIN) - { - cont = 0; break; - } + goto done; } } diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 90e30ea3d6..2fb243b9bd 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -577,10 +577,8 @@ static int mroute_read(struct thread *t) if (errno == EINTR) continue; if (errno == EWOULDBLOCK || errno == EAGAIN) - { - cont = 0; - break; - } + break; + if (PIM_DEBUG_MROUTE) zlog_warn("%s: failure reading fd=%d: errno=%d: %s", __PRETTY_FUNCTION__, fd, errno, safe_strerror(errno)); diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index f82687245d..b2f858b7d9 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -310,10 +310,8 @@ static int pim_sock_read(struct thread *t) if (errno == EINTR) continue; if (errno == EWOULDBLOCK || errno == EAGAIN) - { - cont = 0; - break; - } + break; + if (PIM_DEBUG_PIM_PACKETS) zlog_debug ("Received errno: %d %s", errno, safe_strerror (errno)); goto done;