Re: [libvirt PATCH v2 1/2] nwfilter: Replace a redundant 'now' variable with a direct time(0) call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 23, 2022 at 18:22:36 +0200, Erik Skultety wrote:
> 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@xxxxxxxxxx>
> ---
>  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

[...]

> @@ -1746,7 +1744,7 @@ virNWFilterSnoopLeaseFileLoad(void)
>                               "line %d corrupt"), ln);
>              break;
>          }
> -        if (ipl.timeout && ipl.timeout < now)
> +        if (ipl.timeout && ipl.timeout < time(0))

'time()' takes a pointer, so the argument should be 'NULL' instead.

>              continue;
>          req = virNWFilterSnoopReqGetByIFKey(ifkey);
>          if (!req) {
> -- 
> 2.37.2
> 




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux