]> xenbits.xensource.com Git - xen.git/commitdiff
libs/light: fix tv_sec fprintf format
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 28 Aug 2021 09:07:09 +0000 (11:07 +0200)
committerIan Jackson <iwj@xenproject.org>
Tue, 31 Aug 2021 17:13:47 +0000 (18:13 +0100)
Don't assume tv_sec is a unsigned long, it is 64 bits on NetBSD 32 bits.
Use %jd and cast to (intmax_t) instead

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
tools/libs/light/libxl_domain.c

index c00c36c92879bfaba9b7e056625dc471c84e193d..51a6127552e9ee89f71f91a76ff3534ea48a2579 100644 (file)
@@ -1444,7 +1444,7 @@ static int libxl__mark_domid_recent(libxl__gc *gc, uint32_t domid)
         }
     }
 
-    r = fprintf(nf, "%lu %u\n", ctxt.ts.tv_sec, domid);
+    r = fprintf(nf, "%jd %u\n", (intmax_t)ctxt.ts.tv_sec, domid);
     if (r < 0) {
         LOGED(ERROR, domid, "failed to write to '%s'", new);
         goto out;