diff options
Diffstat (limited to 'fs/file.c')
-rw-r--r-- | fs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -900,7 +900,7 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags) | |||
900 | return __close_fd(files, fd); | 900 | return __close_fd(files, fd); |
901 | 901 | ||
902 | if (fd >= rlimit(RLIMIT_NOFILE)) | 902 | if (fd >= rlimit(RLIMIT_NOFILE)) |
903 | return -EMFILE; | 903 | return -EBADF; |
904 | 904 | ||
905 | spin_lock(&files->file_lock); | 905 | spin_lock(&files->file_lock); |
906 | err = expand_files(files, fd); | 906 | err = expand_files(files, fd); |
@@ -926,7 +926,7 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) | |||
926 | return -EINVAL; | 926 | return -EINVAL; |
927 | 927 | ||
928 | if (newfd >= rlimit(RLIMIT_NOFILE)) | 928 | if (newfd >= rlimit(RLIMIT_NOFILE)) |
929 | return -EMFILE; | 929 | return -EBADF; |
930 | 930 | ||
931 | spin_lock(&files->file_lock); | 931 | spin_lock(&files->file_lock); |
932 | err = expand_files(files, newfd); | 932 | err = expand_files(files, newfd); |