Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106379
b: refs/heads/master
c: 3c33393
h: refs/heads/master
i:
  106377: a300902
  106375: 148a00d
v: v3
  • Loading branch information
Ulrich Drepper authored and Al Viro committed Jul 27, 2008
1 parent c934d68 commit 0b138a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: 58ec42b061bf5dad8fa0370a19966cfd96eaf80c
refs/heads/master: 3c333937ee3be114b181c4861188cfe8f6a59697
7 changes: 6 additions & 1 deletion trunk/fs/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,13 @@ asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
if (!(file = fcheck(oldfd)))
goto out_unlock;
err = newfd;
if (newfd == oldfd)
if (unlikely(newfd == oldfd)) {
if (flags & O_CLOEXEC) {
fdt = files_fdtable(files);
FD_SET(newfd, fdt->close_on_exec);
}
goto out_unlock;
}
err = -EBADF;
if (newfd >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur)
goto out_unlock;
Expand Down

0 comments on commit 0b138a7

Please sign in to comment.