initialize clock ID and flags only when copying timespec, a _umtx_time

copy already contains these fields.
This commit is contained in:
David Xu 2012-02-29 02:01:48 +00:00
parent 41c0675e6e
commit c9b01ed581
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232286

View File

@ -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);