X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Ffile.c;h=708d997a77485989d53583084a3e1b99354fb407;hb=1ff05fb7114a6b4118e0f7d89fed2659f7131b0a;hp=d3b5fa80b71b76a973919a6b9cfa2ebb34096adf;hpb=30f02cb7dd2e6a677c1d5ccd614024f2ebec8f1b;p=~andy%2Flinux diff --git a/fs/file.c b/fs/file.c index d3b5fa80b71..708d997a774 100644 --- a/fs/file.c +++ b/fs/file.c @@ -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);