diff options
author | davidxu <davidxu@FreeBSD.org> | 2012-02-29 02:01:48 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2012-02-29 02:01:48 +0000 |
commit | 49fb0a40aae272b8183ccc0f087bd05e0ed20365 (patch) | |
tree | 67b0bf1525733fb4478342ffc01e32f9f26cf73b /sys/kern | |
parent | 77766742e1d536bb65e0b2b9b7bab06d722ccb58 (diff) | |
download | FreeBSD-src-49fb0a40aae272b8183ccc0f087bd05e0ed20365.zip FreeBSD-src-49fb0a40aae272b8183ccc0f087bd05e0ed20365.tar.gz |
initialize clock ID and flags only when copying timespec, a _umtx_time
copy already contains these fields.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_umtx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 49b015e..3888ce9 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); |