summaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel/syscalls.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
commit59223edaa18759982db0a8aced0e77457d10c68e (patch)
tree89354903b01fa0a447bffeefe00df3044495db2e /arch/ppc/kernel/syscalls.c
parentdb7d4daea91e105e3859cf461d7e53b9b77454b2 (diff)
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'arch/ppc/kernel/syscalls.c')
-rw-r--r--arch/ppc/kernel/syscalls.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
index 4d96a6f0a..3aa0becef 100644
--- a/arch/ppc/kernel/syscalls.c
+++ b/arch/ppc/kernel/syscalls.c
@@ -182,18 +182,14 @@ asmlinkage int sys_pipe(int *fildes)
int fd[2];
int error;
- error = verify_area(VERIFY_WRITE, fildes, 8);
- if (error)
- return error;
lock_kernel();
error = do_pipe(fd);
unlock_kernel();
- if (error)
- return error;
- if (__put_user(fd[0],0+fildes)
- || __put_user(fd[1],1+fildes))
- return -EFAULT; /* should we close the fds? */
- return 0;
+ if (!error) {
+ if (copy_to_user(fildes, fd, 2*sizeof(int)))
+ error = -EFAULT;
+ }
+ return error;
}
asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
@@ -205,15 +201,12 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
lock_kernel();
if (!(flags & MAP_ANONYMOUS)) {
- file = fget(fd);
- if (!file)
+ if (fd >= NR_OPEN || !(file = current->files->fd[fd]))
goto out;
}
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
ret = do_mmap(file, addr, len, prot, flags, offset);
- if (file)
- fput(file);
out:
unlock_kernel();
return ret;