[PATCH v2 2/3] clock_getres.2, clock_getcpuclockid.3, pthread_getcpuclockid.3: fix tv_nsec formatting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@xxxxxxxxxxxxxxxxxx>
---
 man2/clock_getres.2          | 8 ++++----
 man3/clock_getcpuclockid.3   | 4 ++--
 man3/pthread_getcpuclockid.3 | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/man2/clock_getres.2 b/man2/clock_getres.2
index 501c878ca..a02bea852 100644
--- a/man2/clock_getres.2
+++ b/man2/clock_getres.2
@@ -467,8 +467,8 @@ displayClock(clockid_t clock, const char *name, bool showRes)
         exit(EXIT_FAILURE);
     }
 
-    printf("%\-15s: %10jd.%03ld (", name,
-           (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);
+    printf("%\-15s: %10jd.%03d (", name,
+           (intmax_t) ts.tv_sec, (int) ts.tv_nsec / 1000000);
 
     days = ts.tv_sec / SECS_IN_DAY;
     if (days > 0)
@@ -486,8 +486,8 @@ displayClock(clockid_t clock, const char *name, bool showRes)
     }
 
     if (showRes)
-        printf("     resolution: %10jd.%09ld\en",
-               (intmax_t) ts.tv_sec, ts.tv_nsec);
+        printf("     resolution: %10jd.%09d\en",
+               (intmax_t) ts.tv_sec, (int) ts.tv_nsec);
 }
 
 int
diff --git a/man3/clock_getcpuclockid.3 b/man3/clock_getcpuclockid.3
index bcc2d981e..b2f2e356f 100644
--- a/man3/clock_getcpuclockid.3
+++ b/man3/clock_getcpuclockid.3
@@ -146,8 +146,8 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    printf("CPU\-time clock for PID %s is %jd.%09ld seconds\en",
-           argv[1], (intmax_t) ts.tv_sec, ts.tv_nsec);
+    printf("CPU\-time clock for PID %s is %jd.%09d seconds\en",
+           argv[1], (intmax_t) ts.tv_sec, (int) ts.tv_nsec);
     exit(EXIT_SUCCESS);
 }
 .EE
diff --git a/man3/pthread_getcpuclockid.3 b/man3/pthread_getcpuclockid.3
index 31dd6a6ef..f481522b3 100644
--- a/man3/pthread_getcpuclockid.3
+++ b/man3/pthread_getcpuclockid.3
@@ -132,7 +132,7 @@ pclock(char *msg, clockid_t cid)
     printf("%s", msg);
     if (clock_gettime(cid, &ts) == \-1)
         handle_error("clock_gettime");
-    printf("%4jd.%03ld\en", (intmax_t) ts.tv_sec, ts.tv_nsec / 1000000);
+    printf("%4jd.%03d\en", (intmax_t) ts.tv_sec, (int) ts.tv_nsec / 1000000);
 }
 
 int
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux