In this very instance having a variable is pointless since there is
only a single time(0) call in the whole function.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/nwfilter/nwfilter_dhcpsnoop.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index a10a14cfc1..18812c0b20 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -1723,13 +1723,11 @@ virNWFilterSnoopLeaseFileLoad(void)
char ipstr[INET_ADDRSTRLEN], srvstr[INET_ADDRSTRLEN];
virNWFilterSnoopIPLease ipl;
virNWFilterSnoopReq *req;
- time_t now;
FILE *fp;
int ln = 0, tmp;
VIR_LOCK_GUARD lock = virLockGuardLock(&virNWFilterSnoopState.snoopLock);
fp = fopen(LEASEFILE, "r");
- time(&now);
while (fp && fgets(line, sizeof(line), fp)) {
if (line[strlen(line)-1] != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -1746,7 +1744,7 @@ virNWFilterSnoopLeaseFileLoad(void)
"line %d corrupt"), ln);
break;
}
- if (ipl.timeout && ipl.timeout < now)
+ if (ipl.timeout && ipl.timeout < time(0))
continue;
req = virNWFilterSnoopReqGetByIFKey(ifkey);
if (!req) {
--
2.37.2