From 9b0e1093a11d09a20d66c6d6378c6dba4305f2c5 Mon Sep 17 00:00:00 2001 From: tjr Date: Sun, 15 Aug 2004 12:24:05 +0000 Subject: Avoid assuming that l_timeval is the same as the native struct timeval in linux_select(). --- sys/compat/linux/linux_misc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 15184f5..6bf235f 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -487,6 +487,7 @@ cleanup: int linux_select(struct thread *td, struct linux_select_args *args) { + l_timeval ltv; struct timeval tv0, tv1, utv, *tvp; int error; @@ -502,8 +503,10 @@ linux_select(struct thread *td, struct linux_select_args *args) * time left. */ if (args->timeout) { - if ((error = copyin(args->timeout, &utv, sizeof(utv)))) + if ((error = copyin(args->timeout, <v, sizeof(ltv)))) goto select_out; + utv.tv_sec = ltv.tv_sec; + utv.tv_usec = ltv.tv_usec; #ifdef DEBUG if (ldebug(select)) printf(LMSG("incoming timeout (%ld/%ld)"), @@ -566,7 +569,9 @@ linux_select(struct thread *td, struct linux_select_args *args) printf(LMSG("outgoing timeout (%ld/%ld)"), utv.tv_sec, utv.tv_usec); #endif - if ((error = copyout(&utv, args->timeout, sizeof(utv)))) + ltv.tv_sec = utv.tv_sec; + ltv.tv_usec = utv.tv_usec; + if ((error = copyout(<v, args->timeout, sizeof(ltv)))) goto select_out; } -- cgit v1.1