X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Ftime-util.c;h=7ee0484258b17c54b49262466613f29fae1b67a6;hb=aa63b97173e12293234cce3b378912eb761778e1;hp=2455636843f8e80b13c0fa8f73ff42aa17fe581d;hpb=f5eb2a086bc5d5d36bc2e4755a1d6b508e202250;p=elogind.git diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 245563684..7ee048425 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -315,7 +315,7 @@ static char *format_timestamp_internal( if (n + 8 > l) return NULL; /* Microseconds part doesn't fit. */ - sprintf(buf + n, ".%06llu", (unsigned long long) (t % USEC_PER_SEC)); + sprintf(buf + n, ".%06"PRI_USEC, t % USEC_PER_SEC); } /* Append the timezone */ @@ -509,11 +509,11 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) { if (j > 0) { k = snprintf(p, l, - "%s"USEC_FMT".%0*llu%s", + "%s"USEC_FMT".%0*"PRI_USEC"%s", p > buf ? " " : "", a, j, - (unsigned long long) b, + b, table[i].suffix); t = 0; @@ -1341,7 +1341,7 @@ unsigned long usec_to_jiffies(usec_t u) { r = sysconf(_SC_CLK_TCK); assert(r > 0); - hz = (unsigned long) r; + hz = r; } return DIV_ROUND_UP(u , USEC_PER_SEC / hz);