]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal/journald-console: fix format-specifier issue
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Wed, 22 Mar 2017 20:34:32 +0000 (21:34 +0100)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Fri, 19 May 2017 12:23:22 +0000 (14:23 +0200)
commitb123d975ca50c5b44adaeb407cfd7da36c123b03
treef7f79056997899ab8e34f2b491ab0952fc8b58d4
parent215a2db41972230e1df7733d29727247685d58dc
journal/journald-console: fix format-specifier issue

timespec::tv_nsec can have different sizes depending on the
host architecture. On x32 in particular, it is 8 bytes long
while the long int type is only 4 bytes long. Hence, using
ld as a format specifier will trigger a format error. Thus,
explicitly cast timespec::tv_nsec to nsec_t and use PRI_NSEC
as the format specifier to make sure the sizes for both match.
src/journal/journald-console.c