]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync/timesyncd-manager: fix format-specifier issue 5624/head
authorMatija Skala <mskala@gmx.com>
Fri, 19 May 2017 12:36:40 +0000 (14:36 +0200)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Fri, 19 May 2017 12:40:07 +0000 (14:40 +0200)
timex::time::tv_sec 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 li as a format specifier will trigger a format
error. Thus, better use PRI_TIME instead of li which is
actually the right format specifier to use for time_t.

src/timesync/timesyncd-manager.c

index 11c495e29188c79b1068f3e1fe5b4dcbfa3f1f68..ae8514550aa990a34f10d67f88d3351d7fb8610f 100644 (file)
@@ -378,7 +378,7 @@ 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"
+                  "  time now     : %"PRI_TIME".%03"PRI_USEC"\n"
                   "  constant     : %"PRI_TIMEX"\n"
                   "  offset       : %+.3f sec\n"
                   "  freq offset  : %+"PRI_TIMEX" (%i ppm)\n",