summaryrefslogtreecommitdiffstats
path: root/common.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-11-27 09:45:13 +0000
committerRoy Marples <roy@marples.name>2008-11-27 09:45:13 +0000
commita4398c7a4ba3614103396b20754409b0531a57d1 (patch)
treeb9db1fb390ceaaee1a570ced3a9da2c7d0fa297c /common.c
parentddeace4bd49828ef6389f59745766119a514095b (diff)
downloaddhcpcd-a4398c7a4ba3614103396b20754409b0531a57d1.tar.xz
Fix warning of monotonic clock existence.
Diffstat (limited to 'common.c')
-rw-r--r--common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/common.c b/common.c
index d68179ff..fdc85c48 100644
--- a/common.c
+++ b/common.c
@@ -218,9 +218,8 @@ get_monotonic(struct timeval *tp)
if (posix_clock_set == 0) {
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
posix_clock = CLOCK_MONOTONIC;
- clock_monotonic = 1;
+ clock_monotonic = posix_clock_set = 1;
}
- posix_clock_set = 1;
}
if (clock_monotonic) {
@@ -242,9 +241,8 @@ get_monotonic(struct timeval *tp)
if (posix_clock_set == 0) {
if (mach_timebase_info(&info) == KERN_SUCCESS) {
factor = (double)info.numer / (double)info.denom;
- clock_monotonic = 1;
+ clock_monotonic = posix_clock_set = 1;
}
- posix_clock_set = 1;
}
if (clock_monotonic) {
nano = mach_absolute_time();