mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Avoid assuming that l_timeval is the same as the native struct timeval
in linux_select().
This commit is contained in:
parent
6fa534bad8
commit
d1d6dbf120
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133747
@ -487,6 +487,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user