aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/osf_sys.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 8509dad31204..8e19acbf2886 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -986,10 +986,12 @@ asmlinkage int
986osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, 986osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
987 struct timeval32 __user *tvp) 987 struct timeval32 __user *tvp)
988{ 988{
989 s64 timeout = MAX_SCHEDULE_TIMEOUT; 989 struct timespec end_time, *to = NULL;
990 if (tvp) { 990 if (tvp) {
991 time_t sec, usec; 991 time_t sec, usec;
992 992
993 to = &end_time;
994
993 if (!access_ok(VERIFY_READ, tvp, sizeof(*tvp)) 995 if (!access_ok(VERIFY_READ, tvp, sizeof(*tvp))
994 || __get_user(sec, &tvp->tv_sec) 996 || __get_user(sec, &tvp->tv_sec)
995 || __get_user(usec, &tvp->tv_usec)) { 997 || __get_user(usec, &tvp->tv_usec)) {
@@ -999,14 +1001,13 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
999 if (sec < 0 || usec < 0) 1001 if (sec < 0 || usec < 0)
1000 return -EINVAL; 1002 return -EINVAL;
1001 1003
1002 if ((unsigned long) sec < MAX_SELECT_SECONDS) { 1004 if (poll_select_set_timeout(to, sec, usec * NSEC_PER_USEC))
1003 timeout = (usec + 1000000/HZ - 1) / (1000000/HZ); 1005 return -EINVAL;
1004 timeout += sec * (unsigned long) HZ; 1006
1005 }
1006 } 1007 }
1007 1008
1008 /* OSF does not copy back the remaining time. */ 1009 /* OSF does not copy back the remaining time. */
1009 return core_sys_select(n, inp, outp, exp, &timeout); 1010 return core_sys_select(n, inp, outp, exp, to);
1010} 1011}
1011 1012
1012struct rusage32 { 1013struct rusage32 {