0004-libs-light-fix-tv_sec-fprintf-format.patch 1.0 KB

123456789101112131415161718192021222324252627282930
  1. From 4881285bcfd8f2e2c913c6e9f011b1e90652f414 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 28 Aug 2021 11:00:07 +0200
  4. Subject: [PATCH] libs/light: fix tv_sec fprintf format
  5. Don't assume tv_sec is a unsigned long, it is 64 bits on NetBSD 32 bits.
  6. Use %jd and cast to (intmax_t) instead
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. [Upstream status: sent to xen-devel@lists.xenproject.org]
  9. ---
  10. tools/libs/light/libxl_domain.c | 2 +-
  11. 1 file changed, 1 insertion(+), 1 deletion(-)
  12. diff --git a/tools/libxl/libxl_domain.c b/tools/libxl/libxl_domain.c
  13. index c00c36c928..51a6127552 100644
  14. --- a/tools/libxl/libxl_domain.c
  15. +++ b/tools/libxl/libxl_domain.c
  16. @@ -1444,7 +1444,7 @@ static int libxl__mark_domid_recent(libxl__gc *gc, uint32_t domid)
  17. }
  18. }
  19. - r = fprintf(nf, "%lu %u\n", ctxt.ts.tv_sec, domid);
  20. + r = fprintf(nf, "%jd %u\n", (intmax_t)ctxt.ts.tv_sec, domid);
  21. if (r < 0) {
  22. LOGED(ERROR, domid, "failed to write to '%s'", new);
  23. goto out;
  24. --
  25. 2.32.0