Use TIME_T_FMT for formatting tv_sec. Bug 1561
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 22 Dec 2014 15:34:22 +0000 (15:34 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 23 Dec 2014 20:23:37 +0000 (20:23 +0000)
src/src/exim.c
src/src/tod.c
src/src/transports/appendfile.c
src/src/transports/tf_maildir.c

index 3f7473776f0a2543d58aec15338955209aadafe2..d6915d4ad209afb1c050eca4f92b7fc10c20711b 100644 (file)
@@ -413,11 +413,11 @@ if (exim_tvcmp(&now_tv, then_tv) <= 0)
     {
     if (!running_in_test_harness)
       {
-      debug_printf("tick check: %lu.%06lu %lu.%06lu\n",
+      debug_printf("tick check: " TIME_T_FMT ".%06lu " TIME_T_FMT ".%06lu\n",
         then_tv->tv_sec, (long) then_tv->tv_usec,
                now_tv.tv_sec, (long) now_tv.tv_usec);
-      debug_printf("waiting %lu.%06lu\n", itval.it_value.tv_sec,
-        (long) itval.it_value.tv_usec);
+      debug_printf("waiting " TIME_T_FMT ".%06lu\n",
+        itval.it_value.tv_sec, (long) itval.it_value.tv_usec);
       }
     }
 
index 0297e375e5c7940ed5200271c026136927071894..8f095aec661acae74af398ba4b1fbc212e8fff94 100644 (file)
@@ -60,7 +60,7 @@ if (type == tod_epoch_l)
   struct timeval tv;
   gettimeofday(&tv, NULL);
   /* Unix epoch/usec format */
-  (void) sprintf(CS timebuf, "%ld%06ld", tv.tv_sec, (long) tv.tv_usec );
+  (void) sprintf(CS timebuf, TIME_T_FMT "%06ld", tv.tv_sec, (long) tv.tv_usec );
   return timebuf;
   }
 
index f56862beca3fcbb40e5d2c8c7f088e49c1a94e59..d8664be2e7e4d862a90fbfca3ad5fe3a543f5fb6 100644 (file)
@@ -2540,8 +2540,8 @@ else
       uschar *basename;
 
       (void)gettimeofday(&msg_tv, NULL);
-      basename = string_sprintf("%lu.H%luP%lu.%s", msg_tv.tv_sec,
-        msg_tv.tv_usec, getpid(), primary_hostname);
+      basename = string_sprintf(TIME_T_FMT ".H%luP%lu.%s",
+               msg_tv.tv_sec, msg_tv.tv_usec, getpid(), primary_hostname);
 
       filename = dataname = string_sprintf("tmp/%s", basename);
       newname = string_sprintf("new/%s", basename);
index cfe7cb291ba9466a34afea82efea2ffe5a18b281..93bbba455c1a91675ecf46e171783e65153a66f6 100644 (file)
@@ -554,8 +554,8 @@ else
     FALSE);
 
   (void)gettimeofday(&tv, NULL);
-  tempname = string_sprintf("%s/tmp/%lu.H%luP%lu.%s", path, tv.tv_sec,
-    tv.tv_usec, (long unsigned) getpid(), primary_hostname);
+  tempname = string_sprintf("%s/tmp/" TIME_T_FMT ".H%luP%lu.%s",
+    path, tv.tv_sec, tv.tv_usec, (long unsigned) getpid(), primary_hostname);
 
   fd = Uopen(tempname, O_RDWR|O_CREAT|O_EXCL, ob->mode ? ob->mode : 0600);
   if (fd >= 0)