]> git.saurik.com Git - apple/libc.git/blobdiff - gen/clock_gettime.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / gen / clock_gettime.c
index 7be0ad78aeb21c855dc560797678da7a0c5b6681..783a2517237917db1fa67ce7cd09c82060c5e9c0 100644 (file)
@@ -214,8 +214,10 @@ clock_settime(clockid_t clk_id, const struct timespec *tp)
 {
     switch(clk_id){
     case CLOCK_REALTIME: {
-        struct timeval tv;
-        TIMESPEC_TO_TIMEVAL(&tv,tp)
+        struct timeval tv = {
+            .tv_sec = (time_t)tp->tv_sec,
+            .tv_usec = (suseconds_t)(tp->tv_nsec / NSEC_PER_USEC)
+        };
         return settimeofday(&tv, NULL);
     }
     default: