From c9b01ed58183ed8de847e0f24c0e62af1f1d6684 Mon Sep 17 00:00:00 2001 From: David Xu Date: Wed, 29 Feb 2012 02:01:48 +0000 Subject: [PATCH] initialize clock ID and flags only when copying timespec, a _umtx_time copy already contains these fields. --- sys/kern/kern_umtx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 49b015e9c980..3888ce9ed210 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2937,11 +2937,11 @@ umtx_copyin_umtx_time(const void *addr, size_t size, struct _umtx_time *tp) { int error; - tp->_clockid = CLOCK_REALTIME; - tp->_flags = 0; - if (size <= sizeof(struct timespec)) + if (size <= sizeof(struct timespec)) { + tp->_clockid = CLOCK_REALTIME; + tp->_flags = 0; error = copyin(addr, &tp->_timeout, sizeof(struct timespec)); - else + } else error = copyin(addr, tp, sizeof(struct _umtx_time)); if (error != 0) return (error);