summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-08-15 12:24:05 +0000
committertjr <tjr@FreeBSD.org>2004-08-15 12:24:05 +0000
commit9b0e1093a11d09a20d66c6d6378c6dba4305f2c5 (patch)
treef2fa698a97686e12fb3c2d3429ace6eaf5c6ccdb /sys/compat
parentf85b6dc63e16d9af195105647f4b165a627bf4a2 (diff)
downloadFreeBSD-src-9b0e1093a11d09a20d66c6d6378c6dba4305f2c5.zip
FreeBSD-src-9b0e1093a11d09a20d66c6d6378c6dba4305f2c5.tar.gz
Avoid assuming that l_timeval is the same as the native struct timeval
in linux_select().
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_misc.c9
1 files changed, 7 insertions, 2 deletions
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, &ltv, 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(&ltv, args->timeout, sizeof(ltv))))
goto select_out;
}
OpenPOWER on IntegriCloud