Re: [PATCH v7 08/19] tpm: Check whether previously found executables were updated

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

 



On Thu, Jul 25, 2019 at 02:22:04PM -0400, Stefan Berger wrote:
> Check whether previously found executables were updated and if
> so look for them again. This helps to use updated features of
> swtpm and its tools upon updating them.
> 
> Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxx>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> ---
>  src/qemu/qemu_tpm.c |  1 +
>  src/util/virtpm.c   | 34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 35 insertions(+)
> 

> +            if (!findit &&
> +                memcmp(&statbuf.st_mtim,
> +                       &prgs[i].stat->st_mtime,

You're comparing st_mtim against st_mtime, but luckily that works
due to the back magic for defining this struct.

More seriously though st_mtim is non-portable so this broke the
Windows build. I've just changed it to st_mtime and done a plain
integer comparison instead of memcmp. There's no  compelling reason
for this to use nanosecond precision

> +                       sizeof(statbuf.st_mtim))) {
> +                findit = true;
> +            }
> +        }

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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