Merge pull request #4612 from keszybz/format-strings
Format string tweaks (and a small fix on 32bit)
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "login-util.h"
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "io-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "macro.h"
|
||||
|
||||
#define procfs_file_alloca(pid, field) \
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "macro.h"
|
||||
#include "missing.h"
|
||||
#include "rlimit-util.h"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "missing.h"
|
||||
|
||||
@@ -309,7 +309,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 */
|
||||
@@ -499,11 +499,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;
|
||||
@@ -1320,7 +1320,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);
|
||||
|
||||
@@ -29,8 +29,10 @@
|
||||
typedef uint64_t usec_t;
|
||||
typedef uint64_t nsec_t;
|
||||
|
||||
#define NSEC_FMT "%" PRIu64
|
||||
#define USEC_FMT "%" PRIu64
|
||||
#define PRI_NSEC PRIu64
|
||||
#define PRI_USEC PRIu64
|
||||
#define NSEC_FMT "%" PRI_NSEC
|
||||
#define USEC_FMT "%" PRI_USEC
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "macro.h"
|
||||
#include "missing.h"
|
||||
#include "parse-util.h"
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
#include "dirent-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "hostname-util.h"
|
||||
#include "log.h"
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "formats-util.h"
|
||||
#include "format-util.h"
|
||||
#include "macro.h"
|
||||
#include "missing.h"
|
||||
#include "time-util.h"
|
||||
|
||||
Reference in New Issue
Block a user