|
@@ -900,7 +900,7 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags)
|
|
|
return __close_fd(files, fd);
|
|
|
|
|
|
if (fd >= rlimit(RLIMIT_NOFILE))
|
|
|
- return -EMFILE;
|
|
|
+ return -EBADF;
|
|
|
|
|
|
spin_lock(&files->file_lock);
|
|
|
err = expand_files(files, fd);
|
|
@@ -926,7 +926,7 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
|
|
|
return -EINVAL;
|
|
|
|
|
|
if (newfd >= rlimit(RLIMIT_NOFILE))
|
|
|
- return -EMFILE;
|
|
|
+ return -EBADF;
|
|
|
|
|
|
spin_lock(&files->file_lock);
|
|
|
err = expand_files(files, newfd);
|