aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/mqueue.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-03 15:28:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-03 16:50:33 -0400
commit269f21344b23e552c21c9e2d7ca258479dcd7a0a (patch)
treecca8c73bba632a716c901c9843cc865cd40ad9ee /ipc/mqueue.c
parentd35c7b0e54a596c5a8134d75999b7f391a9c6550 (diff)
tiny mq_open optimization
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>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r--ipc/mqueue.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 94fd3b08fb77..b3b69fd51330 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -673,7 +673,7 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
673 if (IS_ERR(name = getname(u_name))) 673 if (IS_ERR(name = getname(u_name)))
674 return PTR_ERR(name); 674 return PTR_ERR(name);
675 675
676 fd = get_unused_fd(); 676 fd = get_unused_fd_flags(O_CLOEXEC);
677 if (fd < 0) 677 if (fd < 0)
678 goto out_putname; 678 goto out_putname;
679 679
@@ -709,7 +709,6 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
709 goto out_putfd; 709 goto out_putfd;
710 } 710 }
711 711
712 set_close_on_exec(fd, 1);
713 fd_install(fd, filp); 712 fd_install(fd, filp);
714 goto out_upsem; 713 goto out_upsem;
715 714