Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144843
b: refs/heads/master
c: 2b79bc4
h: refs/heads/master
i:
  144841: 3bdd71c
  144839: 5d636aa
v: v3
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed May 11, 2009
1 parent 84a8f3b commit 35fef43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd18de50b9e7965f93d231e7390436fb8900c0e6
refs/heads/master: 2b79bc4f7ebbd5af3c8b867968f9f15602d5f802
6 changes: 4 additions & 2 deletions trunk/fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
{
if (unlikely(newfd == oldfd)) { /* corner case */
struct files_struct *files = current->files;
int retval = oldfd;

rcu_read_lock();
if (!fcheck_files(files, oldfd))
oldfd = -EBADF;
retval = -EBADF;
rcu_read_unlock();
return oldfd;
return retval;
}
return sys_dup3(oldfd, newfd, 0);
}
Expand Down

0 comments on commit 35fef43

Please sign in to comment.