aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/osf_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/kernel/osf_sys.c')
-rw-r--r--arch/alpha/kernel/osf_sys.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 8509dad31204..18a3ea1aac51 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -165,14 +165,11 @@ osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent,
165 buf.error = 0; 165 buf.error = 0;
166 166
167 error = vfs_readdir(file, osf_filldir, &buf); 167 error = vfs_readdir(file, osf_filldir, &buf);
168 if (error < 0) 168 if (error >= 0)
169 goto out_putf; 169 error = buf.error;
170
171 error = buf.error;
172 if (count != buf.count) 170 if (count != buf.count)
173 error = count - buf.count; 171 error = count - buf.count;
174 172
175 out_putf:
176 fput(file); 173 fput(file);
177 out: 174 out:
178 return error; 175 return error;
@@ -986,10 +983,12 @@ asmlinkage int
986osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, 983osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
987 struct timeval32 __user *tvp) 984 struct timeval32 __user *tvp)
988{ 985{
989 s64 timeout = MAX_SCHEDULE_TIMEOUT; 986 struct timespec end_time, *to = NULL;
990 if (tvp) { 987 if (tvp) {
991 time_t sec, usec; 988 time_t sec, usec;
992 989
990 to = &end_time;
991
993 if (!access_ok(VERIFY_READ, tvp, sizeof(*tvp)) 992 if (!access_ok(VERIFY_READ, tvp, sizeof(*tvp))
994 || __get_user(sec, &tvp->tv_sec) 993 || __get_user(sec, &tvp->tv_sec)
995 || __get_user(usec, &tvp->tv_usec)) { 994 || __get_user(usec, &tvp->tv_usec)) {
@@ -999,14 +998,13 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
999 if (sec < 0 || usec < 0) 998 if (sec < 0 || usec < 0)
1000 return -EINVAL; 999 return -EINVAL;
1001 1000
1002 if ((unsigned long) sec < MAX_SELECT_SECONDS) { 1001 if (poll_select_set_timeout(to, sec, usec * NSEC_PER_USEC))
1003 timeout = (usec + 1000000/HZ - 1) / (1000000/HZ); 1002 return -EINVAL;
1004 timeout += sec * (unsigned long) HZ; 1003
1005 }
1006 } 1004 }
1007 1005
1008 /* OSF does not copy back the remaining time. */ 1006 /* OSF does not copy back the remaining time. */
1009 return core_sys_select(n, inp, outp, exp, &timeout); 1007 return core_sys_select(n, inp, outp, exp, to);
1010} 1008}
1011 1009
1012struct rusage32 { 1010struct rusage32 {