1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-23 02:04:32 +03:00

Merge pull request #5624 from glaubitz/x32

Fix multiple issues with incorrect usage of format specifiers
This commit is contained in:
Lennart Poettering 2017-05-19 19:17:57 +02:00 committed by GitHub
commit 07755554ab
4 changed files with 13 additions and 7 deletions

View File

@ -54,6 +54,12 @@
# error Unknown time_t size
#endif
#if defined __x86_64__ && defined __ILP32__
# define PRI_TIMEX PRIi64
#else
# define PRI_TIMEX "li"
#endif
#if SIZEOF_RLIM_T == 8
# define RLIM_FMT "%" PRIu64
#elif SIZEOF_RLIM_T == 4

View File

@ -72,9 +72,9 @@ void server_forward_console(
/* First: timestamp */
if (prefix_timestamp()) {
assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
xsprintf(tbuf, "[%5"PRI_TIME".%06ld] ",
xsprintf(tbuf, "[%5"PRI_TIME".%06"PRI_NSEC"] ",
ts.tv_sec,
ts.tv_nsec / 1000);
(nsec_t)ts.tv_nsec / 1000);
IOVEC_SET_STRING(iovec[n++], tbuf);
}

View File

@ -378,10 +378,10 @@ static int manager_adjust_clock(Manager *m, double offset, int leap_sec) {
m->drift_ppm = tmx.freq / 65536;
log_debug(" status : %04i %s\n"
" time now : %li.%03"PRI_USEC"\n"
" constant : %li\n"
" time now : %"PRI_TIME".%03"PRI_USEC"\n"
" constant : %"PRI_TIMEX"\n"
" offset : %+.3f sec\n"
" freq offset : %+li (%i ppm)\n",
" freq offset : %+"PRI_TIMEX" (%i ppm)\n",
tmx.status, tmx.status & STA_UNSYNC ? "unsync" : "sync",
tmx.time.tv_sec, tmx.time.tv_usec / NSEC_PER_MSEC,
tmx.constant,

View File

@ -41,9 +41,9 @@ static void print_device(struct udev_device *device, const char *source, int pro
struct timespec ts;
assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
printf("%-6s[%"PRI_TIME".%06"PRI_NSEC"] %-8s %s (%s)\n",
source,
ts.tv_sec, ts.tv_nsec/1000,
ts.tv_sec, (nsec_t)ts.tv_nsec/1000,
udev_device_get_action(device),
udev_device_get_devpath(device),
udev_device_get_subsystem(device));