diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-23 18:18:40 -0400 |
commit | fc05505b77f7900a1bb74fb3f3a4343dee4265a4 (patch) | |
tree | 6517919cb60bd9465078512cacbefd8c77f94b76 /fs/fcntl.c | |
parent | a2ab67fae1ab9226679495a8d260f4e6555efc5f (diff) | |
parent | 11c79740d3c03cb81f84e98cf2e2dbd8d9bb53cd (diff) |
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 into devel
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c index cc8e4de2fee5..1ad703150dee 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -117,11 +117,13 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) | |||
117 | { | 117 | { |
118 | if (unlikely(newfd == oldfd)) { /* corner case */ | 118 | if (unlikely(newfd == oldfd)) { /* corner case */ |
119 | struct files_struct *files = current->files; | 119 | struct files_struct *files = current->files; |
120 | int retval = oldfd; | ||
121 | |||
120 | rcu_read_lock(); | 122 | rcu_read_lock(); |
121 | if (!fcheck_files(files, oldfd)) | 123 | if (!fcheck_files(files, oldfd)) |
122 | oldfd = -EBADF; | 124 | retval = -EBADF; |
123 | rcu_read_unlock(); | 125 | rcu_read_unlock(); |
124 | return oldfd; | 126 | return retval; |
125 | } | 127 | } |
126 | return sys_dup3(oldfd, newfd, 0); | 128 | return sys_dup3(oldfd, newfd, 0); |
127 | } | 129 | } |