summaryrefslogtreecommitdiff
path: root/xserver/os
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2011-04-02 16:08:42 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2011-04-02 16:08:42 +0000
commit45d2cfad3bb2ac4246dc1863e5b8689d6bb34fa8 (patch)
tree8cf9735d4bf7b17b11cb2b5f9d56b797d20c438d /xserver/os
parent68fd41f12f9344d45b8a897e368548c7dcb0d366 (diff)
Update to xserver 1.9.5. Tested by jasper@, ajacoutot@ and krw@
Diffstat (limited to 'xserver/os')
-rw-r--r--xserver/os/access.c4
-rw-r--r--xserver/os/utils.c16
2 files changed, 18 insertions, 2 deletions
diff --git a/xserver/os/access.c b/xserver/os/access.c
index 027925927..eb91ea35e 100644
--- a/xserver/os/access.c
+++ b/xserver/os/access.c
@@ -1145,8 +1145,10 @@ Bool LocalClient(ClientPtr client)
}
for (host = selfhosts; host; host = host->next)
{
- if (addrEqual (family, addr, alen, host))
+ if (addrEqual (family, addr, alen, host)) {
+ free(from);
return TRUE;
+ }
}
free(from);
}
diff --git a/xserver/os/utils.c b/xserver/os/utils.c
index c1836ac84..f45f9b4a4 100644
--- a/xserver/os/utils.c
+++ b/xserver/os/utils.c
@@ -445,7 +445,21 @@ GetTimeInMillis(void)
#ifdef MONOTONIC_CLOCK
struct timespec tp;
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ static clockid_t clockid;
+ if (!clockid) {
+#ifdef CLOCK_MONOTONIC_COARSE
+ if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
+ (tp.tv_nsec / 1000) <= 1000 &&
+ clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
+ clockid = CLOCK_MONOTONIC_COARSE;
+ else
+#endif
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ clockid = CLOCK_MONOTONIC;
+ else
+ clockid = ~0L;
+ }
+ if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
#endif