A very small cleanup for mq_open.
We do not have to call set_close_on_exit if we create the file
descriptor right away with the flag set. We have a function for this
now. The resulting code is smaller and a tiny bit faster.
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
if (IS_ERR(name = getname(u_name)))
return PTR_ERR(name);
- fd = get_unused_fd();
+ fd = get_unused_fd_flags(O_CLOEXEC);
if (fd < 0)
goto out_putname;
goto out_putfd;
}
- set_close_on_exec(fd, 1);
fd_install(fd, filp);
goto out_upsem;