aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/compat.c5
-rw-r--r--fs/select.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/fs/compat.c b/fs/compat.c
index fe3c9bf87608..e5f49f538502 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1684,8 +1684,9 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
1684 return -EFAULT; 1684 return -EFAULT;
1685 1685
1686 to = &end_time; 1686 to = &end_time;
1687 if (poll_select_set_timeout(to, tv.tv_sec, 1687 if (poll_select_set_timeout(to,
1688 tv.tv_usec * NSEC_PER_USEC)) 1688 tv.tv_sec + (tv.tv_usec / USEC_PER_SEC),
1689 (tv.tv_usec % USEC_PER_SEC) * NSEC_PER_USEC))
1689 return -EINVAL; 1690 return -EINVAL;
1690 } 1691 }
1691 1692
diff --git a/fs/select.c b/fs/select.c
index 448e44001286..87df51eadcf2 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -519,8 +519,9 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
519 return -EFAULT; 519 return -EFAULT;
520 520
521 to = &end_time; 521 to = &end_time;
522 if (poll_select_set_timeout(to, tv.tv_sec, 522 if (poll_select_set_timeout(to,
523 tv.tv_usec * NSEC_PER_USEC)) 523 tv.tv_sec + (tv.tv_usec / USEC_PER_SEC),
524 (tv.tv_usec % USEC_PER_SEC) * NSEC_PER_USEC))
524 return -EINVAL; 525 return -EINVAL;
525 } 526 }
526 527