projects
/
darkstat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update portability notes.
[darkstat]
/
now.c
diff --git
a/now.c
b/now.c
index
0bc0061
..
b1a43cb
100644
(file)
--- a/
now.c
+++ b/
now.c
@@
-23,7
+23,8
@@
#include <string.h>
#include <time.h>
#include <string.h>
#include <time.h>
-#ifdef __MACH__ /* Fake up clock_gettime() on OS X. */
+#if defined(__MACH__) && !defined(__gnu_hurd__)
+/* Fake up clock_gettime() on OS X. */
# include <sys/time.h>
# include <inttypes.h>
# include <mach/mach.h>
# include <sys/time.h>
# include <inttypes.h>
# include <mach/mach.h>
@@
-119,14
+120,14
@@
void now_update(void) {
all_clocks_update();
}
all_clocks_update();
}
-time_t mono_to_real(const
time
_t t) {
+time_t mono_to_real(const
int64
_t t) {
assert(now_initialized);
assert(now_initialized);
- return
t - clock_mono.tv_sec + clock_real.tv_sec
;
+ return
(time_t)(t - (int64_t)clock_mono.tv_sec + (int64_t)clock_real.tv_sec)
;
}
}
-
time
_t real_to_mono(const time_t t) {
+
int64
_t real_to_mono(const time_t t) {
assert(now_initialized);
assert(now_initialized);
- return
t - clock_real.tv_sec + clock_mono.tv_sec
;
+ return
(int64_t)(t - clock_real.tv_sec + clock_mono.tv_sec)
;
}
void timer_start(struct timespec *t) {
}
void timer_start(struct timespec *t) {