clock_gettime.patch 433 B

123456789101112131415161718
  1. --- lasagna/tain/tain_now.c.orig 2013-01-11 12:10:32.000000000 -0300
  2. +++ lasagna/tain/tain_now.c 2017-05-18 23:45:24.000000000 -0300
  3. @@ -13,11 +13,11 @@
  4. struct tain *
  5. tain_now(struct tain *t)
  6. {
  7. - struct timeval now;
  8. + struct timespec now;
  9. - gettimeofday(&now, NULL);
  10. + clock_gettime(CLOCK_REALTIME, &now);
  11. tain_load_utc(t, now.tv_sec);
  12. - t->nsec = (1000 * now.tv_usec) + 500;
  13. + t->nsec = now.tv_nsec;
  14. return t;
  15. }